How can I retrieve values from a child table

We are running 3.3 version of Syncfusion grid in vb.net. I need to retrieve values from a row in a child table that is currently selected in a grid. I tried the following code: Dim r As Grouping.GridRecord = Me.GridGroupingControl1.Table.DisplayElements(Me.GridGroupingControl1.TableControl.CurrentCell.RowIndex).GetRecord MessageBox.Show(r.GetValue("Railcar")+ ''" - " + r.GetValue("MoveDate"))) This code only allows access to the parent table. I am new at using the Syncfusion Grid. Could someone provide me code snipets that will return child values of the row that is currently selected? Thanks,

2 Replies

AD Administrator Syncfusion Team April 5, 2006 06:28 AM UTC

Hi Steve, Please try the below snipped code to get the current record form parent/child table. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim el As Element = Me.GridGroupingControl1.Table.GetInnerMostCurrentElement() Dim rec As GridRecord = CType(IIf(TypeOf el Is GridRecord, el, Nothing), GridRecord) If Not (rec Is Nothing) Then MessageBox.Show(rec.GetValue("Railcar") + " - " & rec.GetValue("MoveDate")) End If End Sub Regards, Calvin.


SK Steve Killingsworthnolongercoding.NET April 5, 2006 01:05 PM UTC

>Hi Steve, > >Please try the below snipped code to get the current record form parent/child table. > >Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click > > Dim el As Element = Me.GridGroupingControl1.Table.GetInnerMostCurrentElement() > Dim rec As GridRecord = CType(IIf(TypeOf el Is GridRecord, el, Nothing), GridRecord) > If Not (rec Is Nothing) Then > MessageBox.Show(rec.GetValue("Railcar") + " - " & rec.GetValue("MoveDate")) > End If > > End Sub > >Regards, >Calvin. > Thanks...It Worked

Loader.
Up arrow icon