Master Detail DataGrid

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
 
G

Guest

Thank you Cor. I appreciate your help. Your contribution to this thread is
invaluable to us.
Thank you,
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top