Wednesday, 22 August 2012

How to Set a DataItemIndex for a devexpress ASPxGridView

To Get a DataItemIndex in an ASPxGridView I suggest you add an unbound column to your ASPxGridView that will contain the row datasource index. Handle the server-side ASPxGridView.CustomUnboundColumnData event to provide data to this column. Use the ASPxGridViewColumnDataEventArgs.ListSourceRowIndex property to get the processed row's datasource index. Then, you can get data from this unbound column by using the server-side ASPxGridView.GetRowValues method. You can use this code to implement this task: After that, use this code to get the row's datasource index by its visible index:

No comments:

Post a Comment