Rank: Newbie Groups: Member
Joined: 1/27/2009 Posts: 3
|
Which of the grid Procedures if any are similiar to the RowDataBOound in GridView or do I need to create a custom one in code?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Unfortunately I do not think it has a direct equivalent for that. If you do need to modify the Grid after data binding, you can do it directly after DataBind is called. For example:
Grid1.DataSource = Your_Data_Source; Grid1.DataBind(); Grid1.Items[0].Cells[0].Value = something;
If you need to work on all items, you would simply use a for loop to loop through all of them. The difference between our Grid and ASP.NET GridView is that our Grid is very much a client side Grid. So unlike ASP.NET GridView where each grid item is a server control, our grid item is mostly a data object. As such you can change the data and a few other things about it, but you can not use it as if it is a control --- which is one of the main benefits of RowDataBound event.
Another benefit of RowDataBound event is that you can have access to the DB record that was used to populate that row. In the case of our Grid, you would simply populate such data into the Grid. The Grid provides a KeyField property specifically for this purpose. This allows you to hold an additional piece of data with each grid item. That additional data is entirely for you to use, the Grid only helps you to get it from the database and hold it for you.
Hope this helps.
Thanks!
|