Get value of a column in a selected row in GDBG

hi! I've got the following problem: I made a GDBG. It's datasource is me.dataset1.table1. When a user doubleclicks a row i want to get the value of me.dataset1.table1(Clickedrow).Column5. this works up to now. but when the GDBG is sorted by a column, then the above example returns the wrong value because it references a wrong row in the datasource.

1 Reply

AD Administrator Syncfusion Team August 28, 2003 07:27 AM UTC

You can get the currently selected row in your DataTable through the CurrencyManager even if the table is filtered and/or sorted. If HiddenCol is the name of a column in your datatable, you can get at the value of this column in the current row through code like: Dim cm As CurrencyManager = Me.BindingContext(Me.GridDataBoundGrid1.DataSource, Me.GridDataBoundGrid1.DataMember) Dim dr As DataRow = CType(cm.Current, DataRowView).Row Me.Label1.Text = dr("HiddenCol").ToString()

Loader.
Up arrow icon