Thats nice code... However im working with WinForms and the WinForm DataGrid. i Did however fix the problem.
C#
Code:
à BindingManagerBase bm =
à à ((System.Windows.Forms.DataGrid)sender).BindingContext[
à à à ((System.Windows.Forms.DataGrid)sender).DataSource,
à à à ((System.Windows.Forms.DataGrid)sender).DataMember];
à DataRow dr = ((DataRowView)(bm.Current)).Row;
VB (Converted by hand from C#, hope its 100% correct.)
Code:
à Dim bm As BindingManagerBase =
à à CType(sender, System.Windows.Forms.DataGrid).BindingContext(
à à à CType(sender, System.Windows.Forms.DataGrid).DataSource,
à à à CType(sender, System.Windows.Forms.DataGrid).DataMember)
à Dim dr As DataRow = CType(bm.Current, DataRowView).Row