Problem in selecting row after sorting in datagrid...

  • Thread starter Thread starter Deep Silent Ocean
  • Start date Start date
D

Deep Silent Ocean

Hi All

I have one specific question for DataGrid

In the Form Load event of the Form, I am binding data with DataGrid.

On clicking Row the CurrentRowIndex is updated and it gives me correct
rowindex.

But if, I click on Column the data gets sorted in ascending or
descending order. But with that currentrowindex is not updated. It
remains the same as the one when it was during the original data binding.

So, on clicking the row it does not return me the right now. It seems
the datagried is view is sorted but rowindex is not updated.

How can refresh the datagrid and can always get the right row evern
after sorting

~ Regards

Silent Ocean
 
Deep,

Don't use the rows from the datagrid, try to use the rows from the
datatable.defaultview

I hope this helps,

Cor
 
Back
Top