Problem in selecting row after sorting in datagrid...

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
 
C

Cor Ligthert [MVP]

Deep,

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

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top