emaduddeen
Well-known member
- Joined
- May 5, 2010
- Messages
- 171
- Location
- Lowell, MA & Occasionally Indonesia
- Programming Experience
- Beginner
Hi Everyone,
Can you tell me the best way to get a dataset row and column for the currently highlighted row in a datagrid?
Using this code works ok as long as the user does not insert or delete from the dataset but editing is ok.
If the user inserts, or deletes a row from the dataset then executes this code then the error shown in the attachment is displayed. Also when inserting, or deleting the value representing the ID number does not match what was in the dataview before the insert, or delete where the highlight bar is resting.
Could you tell me the best way to avoid the error?
Thanks.
Truly,
Emad
Can you tell me the best way to get a dataset row and column for the currently highlighted row in a datagrid?
Using this code works ok as long as the user does not insert or delete from the dataset but editing is ok.
VB.NET:
' This parent ID is the key column for the Parents table.
'--------------------------------------------------------
With LightGridParentNames
intParentID = objDataSetParentNames.Tables("Parents").Rows(.CurrentRow.Index).Item("ID")
End With
If the user inserts, or deletes a row from the dataset then executes this code then the error shown in the attachment is displayed. Also when inserting, or deleting the value representing the ID number does not match what was in the dataview before the insert, or delete where the highlight bar is resting.
Could you tell me the best way to avoid the error?
Thanks.
Truly,
Emad