|
Rank: Member Groups: Member
Joined: 2/9/2010 Posts: 21
|
Hi, I have lots of server textBox objects that user can enter data. User will click a server button to append those textbox objects data to grid finally.
Sample: Dim newItem As GridItem newItem = Grid1.CreateItem()
newItem.Cells(2).Value = txtData1.Text newItem.Cells(3).Value = txtData2.Text
But i can't set value from txtData1.Text to newItem.Cells(2). Because newItem.Cells(2).Value is get value from grid. How can i set textbox.text to item cell?
PS:i don''t wana add item from client side.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
You code looks fine to us except that you still need to call Grid1.Items.Add(newItem) to add the new item to the Grid. I am not sure what you mean by "Because newItem.Cells(2).Value is getting value from the Grid" though. The Grid doesn't make up any data on its own. So whatever data it has must be coming from you.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 2/9/2010 Posts: 21
|
Hi, I check the help document about GridCell.Value Property,it says "Gets the current value of the cell.". Can i set any value into GridCell by this property?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
I believe you can. That is what you are doing by "newItem.Cells(2).Value = txtData1.Text".
Thanks!
|
|