Link to home
Start Free TrialLog in
Avatar of drees727
drees727

asked on

ASP.NET 2.0 / Nested Gridview / Function Question

I'm using a nested gridview (idea from:  http://programmers.wordpress.com/2006/07/26/nested-gridview-to-show-masterdetails-relationship-in-aspnet-20/).  My nested gridview contains the following:

<asp:GridView ID="Gridview2" runat="server" DataSource="<%#GetNames(Convert.ToInt32(Eval("ID"))) %>"

I need to create a function that creates a datatable so each time a row is bound to the main gridview, the child gridview is also bound with the corresponding values.  I'm using Access as my database and my nested gridview select command looks something like:

SelectCommand="SELECT Table2.[Name], [Table2].[ChildID] FROM Table2 Where [Table2].[ChildID] = [Table1].[ID]

How do I use VB to create the GetNames function (below) to get this to work?  Thanks for your help!!

**********************************************************************
Public Function GetNames() As DataTable

End Function
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

What are you using for a data source?  ObjectDataSource?

Bob
Avatar of drees727
drees727

ASKER

AccessDataSource
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial