Rank: Newbie Groups: Member
Joined: 2/29/2008 Posts: 1
|
Hi,
I use the EO Grid with an IEnumerable DataSource (array of Employee objects), using RunningMode.Callback. Each grid column is bound to a property (specified in the column's DataField property) in the Employee class. However, after I reorder the columns and navigate to another DataPage, the grid data don't match the new column order.
Should I match the data with the new column order in code? I expect the databinding to do this for me.
Hope you guys can sort this out.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi Danny,
Check whether you have the latest version and if you are rebinding to the Grid every time. We used to have a bug with Grid sorting (not column reordering though) but that has been taken care of. The way the Grid works is:
1. When you DataBind, all data are populated into each grid item. Your data source is no longer needed once this step is done; 2. User can reorder vertically (column reordering) or horizontally (sort) either on the client side or on the server side. The Grid automatically reshuffles the data so that each Cell still holds its original data; 3. When you are back on the server side, the order of columns in Grid.Columns may be different than what it was. So you can no longer rely on zero based index to access them. You can use column name to access the column. For example, Grid1.Columns["first_name"];
Please let us know if this answers your question and feel free to reply back if it doesn't. Also a bit more detailed information such as how it does not match would be helpful for us resolving the issue.
Thanks
|