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


Top 5 Contributors of the Month
Easy Web
Imran Ghani

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
Hello,

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.

--------------------------------
Thanks,
ARIJIT DAS.

Responses
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
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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