G
Guest
I am using the vb .net datagrid for windows forms. How do you unselect the
current row on the dataset? I tried the following:
If (mygrid.CurrentRowIndex <> -1) Then
mygrid.UnSelect(mygrid.CurrentRowIndex())
End If
This does not always set the mygrid.CurrentRowIndex to -1 (As I have found
while debugging)! This is a problem because after this line I set the
datasource and the datamember properties and when mygrid.CurrentRowIndex is
not -1, an error occurs: "Index was out of range. Must be non-negative and
less than the size of the collection."
Any help is appreciated.
current row on the dataset? I tried the following:
If (mygrid.CurrentRowIndex <> -1) Then
mygrid.UnSelect(mygrid.CurrentRowIndex())
End If
This does not always set the mygrid.CurrentRowIndex to -1 (As I have found
while debugging)! This is a problem because after this line I set the
datasource and the datamember properties and when mygrid.CurrentRowIndex is
not -1, an error occurs: "Index was out of range. Must be non-negative and
less than the size of the collection."
Any help is appreciated.