Welcome Guest Search | Active Topics | Sign In | Register

Appending New Item Options
Arthur
Posted: Tuesday, February 9, 2010 2:45:53 AM
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.
eo_support
Posted: Tuesday, February 9, 2010 8:58:30 AM
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!

Arthur
Posted: Wednesday, February 10, 2010 4:31:40 AM
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?
eo_support
Posted: Wednesday, February 10, 2010 9:13:45 AM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.