Re: Getting selected row ID
The fact that you have parentheses after the type in the first line means that you have declared a DataView array, not a single DataView.
Re: Getting selected row ID
Thanks jmc,
I am now getting a specified cast not valid on this line...
Dim dr As System.Data.DataRow = Me._tgDocLog(Me._tgDocLog.Row)
Bob
Re: Getting selected row ID
I've never used that control so I don't know all the ins and outs, but I'd think that if you wanted the DataRow that corresponded to the selected row in the grid then you'd have to go through the DataSource which is you DataView. I'd guess that you should be able to index the DataView by the Position property of the CurrencyManager to get a DataRowView, which has a Row property that is a DataRow from the original DataTable, which I guess is what you want. I'm guessing from your code that the Row property of the grid would give you the same value as the Position property of the CurrencyManager. In short, either of these should work, I think:
VB Code:
Dim dr As System.Data.DataRow = dv(Me._tgDocLog.Row).Row
VB Code:
Dim dr As System.Data.DataRow = dv(cm.Position).Row