[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ASP.NET 2.0 / Nested Gridview / Function Question

Posted on 2006-11-22
3
Medium Priority
?
482 Views
Last Modified: 2012-08-13
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
0
Comment
Question by:drees727
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17998673
What are you using for a data source?  ObjectDataSource?

Bob
0
 

Author Comment

by:drees727
ID: 17998688
AccessDataSource
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 17998810
1) I don't find that the AccessDataSource provides the interface members that you would need to accomplish this.

2) You could use 2 OleDbDataAdapter objects to fill a DataSet with the parent and child tables, and then add a DataRelation to the DataSet, and call DataRow.GetChildRows from the parent row to fill the nested GridView.

Bob
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question