Alex Rivera | Logout

What is difference between RowIndex and DataItemIndex?

Asked 2011-05-17T15:10:16.930
10

In gridview’s RowDataBound event has e.Row.RowIndex and e.Row.DataItemIndex properties.
Please tell me in easily understandable answer, what is difference between them?
In which situation we should use which one?

Edit
Report

1 Answer

2

Well the difference could be that "e.Row.DataItemIndex" applies to DataItem only; means This property applies only to data rows where as "e.Row.RowIndex" could be for datarow, header row, etc.

RowIndex is the current visible row in the rendered table. DataItemIndex is the actual item's index; they both will show the index of the record in the set of currently displayed records.

answered 2011-05-17T15:20:17.993

Your Answer