.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to make a nested datalist control?

Posted By: ASPEvil     Posted Date: December 23, 2015    Points:5   Category :ASP.Net

I am having two sqlserver database tables named as: "employee" and "employee_details". With the "employee" table, only "employee_id" and "employee_name" are there. And with the "employee_details" table, country, city and state of all the employees are mentioned with the "employee_id".

Now, I am fetching all the "employee_name" from the "employee" table and displaying these data to a datalist control and then I put another datalist control inside this datalist control, which will show the country,city and state of each related employee.

The outer datalist control is displaying all the necessary data, but how I can relate the inner datalist control to the outer datalist control to display the related country,city and state for each and every employee of the outer datalist control?

Please let me know it.


Author: Vijay Saklani             
Posted Date: July 19, 2016     Points: 20   
Author: david stephan             
Posted Date: October 26, 2016     Points: 20   

Yes, you can make the nested data-list controls by adding the inner data-list at run item under the itemdatabound event handler of the master data-list control.
On ItemDataBound eventhandler, create another DataList control and fill the values based on the main datalist control.
Hope it will be helpful to you.

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend