Welcome Guest Search | Active Topics | Sign In | Register

How to populate a grid by adding rows and fill cellvalues instead of databinding? Options
Oscar
Posted: Saturday, May 16, 2009 2:55:37 PM
Rank: Member
Groups: Member

Joined: 5/10/2009
Posts: 16
Since I don't deal with recordsets or datareaders I want to populate a grid in an easy way by adding rows and/or cell values one for one. So it doesn't need to be databound at all. I suggest this must be possible but I can't find a method or example in the documentation while I expected this to be a basic feature. Please help.

regards,
Oscar
eo_support
Posted: Saturday, May 16, 2009 3:07:37 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I believe you can call do something like this:

Code: C#
EO.Web.GridItem newItem = grid1.CreateItem();
grid1.Items.Add(newItem);
newItem.Cells[0].Value = "something";


Thanks!
Oscar
Posted: Saturday, May 16, 2009 4:15:14 PM
Rank: Member
Groups: Member

Joined: 5/10/2009
Posts: 16
Hi eo_support,

that works, thank you very much!

Any idea whether it's possible to add a row woth cell values in one action instead of each cell individually?

How can I get the grid directly editable after a row has been added in this way?
eo_support
Posted: Saturday, May 16, 2009 4:21:56 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You can either set value with data binding or with code. If you do it with code, you must set each cell individually.

For the second question, you can set the Grid's EditItemIndex and EditCellIndex.

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.