Click to See Complete Forum and Search --> : CurrentRowIndex in DataGrid don't return the right value


MBonevil
February 27th, 2003, 01:35 PM
I have a DataGrid assiciated with a DataSet.
When the user select a row and click on button, a dialog
appear for allow to modify this row.

If I change some information and click on "Accept change" button, I update the dataset and return to the parent form. After the "child form" is closed I update the DataGrid with the new informations.

But after this CurrentRowIndex return always 0.

Anyone have an idea how to solve this problem ?

MBonevil
February 28th, 2003, 03:10 PM
I found a solution. It's not a great solution but it work.

Before updating my DataGrid I do this :

Dim CurCell As DataGridCell
CurCell = DataGridListe.CurrentCell()


After updating :

DataGridListe.CurrentRowIndex = CurCell.RowNumber



Now when the user select a row, DataGridListe.CurrentRowIndex return the right value !!!

VB strike again (you don't know why it's working, but it's working) :-)