Master Detail DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I found an example of a A Master/Detail DataGrid Control in a MSDN magazine
( http://msdn.microsoft.com/msdnmag/issues/03/08/CuttingEdge/ ). The
code is in c# so I converted it to vb.net and I am having a problem with the
view statement. What have a done wrong? Any ideas would be appreciated.

C# code:

void BindDetails()
{
DataTable table;
table = DataSource.Tables[__tableSelector.CurrentTabIndex];
DataView view = new DataView(table);
DataRowView drv = view[SelectedItemIndex];
DataView detailsView =
drv.CreateChildView("Customer2Orders");

theDetailsGrid.DataSource = detailsView;
theDetailsGrid.DataBind();
}

VB.net Code:

Private Sub BindDetails()
Dim table As DataTable
table = DataSource.Tables(__tableSelector.CurrentTabIndex)
Dim view As DataView = New DataView(table)
Dim drv As DataRowView = view(SelectedItemIndex)
DataView detailsView =
drv.CreateChildView("Customer2Orders")

theDetailsGrid.DataSource = detailsView
theDetailsGrid.DataBind()
End Sub
 
Thank you Cor. I appreciate your help. Your contribution to this thread is
invaluable to us.
Thank you,
Dan
 
Back
Top