Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Nested Datalists in vb.net

Posted on 2007-04-03
3
Medium Priority
?
339 Views
Last Modified: 2008-02-26
Hi,
I want to put a datalist inside another datalist...like a stack - one on top of another
but I do not know if I can do this? Will it overlap my data in column list?
Does anyone know how I can do this... Here is what I am trying to do...
Thanks!

Report_03/23/2005  <- to do to Page2
Report_03/16/2005  <- to do to Page2 (this would be a beginning of my second datalist)
Report_03/09/2005  <- to do to Page1 (this would be my first datalist)  
Report_03/02/2005  <- to do to Page1
Report_02/23/2005  <- to do to Page1
Report_02/16/2005  <- to do to Page1
Report_02/09/2005  <- to do to Page1  and so one...Page1
0
Comment
Question by:avi4
[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
3 Comments
 
LVL 4

Accepted Solution

by:
Neotk earned 2000 total points
ID: 18847074
You can add a datalist inside another... but when you have to work with your nested datalist, you'll have to reference it in code as DataList and work on it. like this:

(I'll try to write in vb... but i'm from c#.. so i'll comment the code, so you'll know what to do in vb)

foreach(DataListItem item in mydatalist1.Items)
{
    //Test if the item on datalist is an item
    if(item.ItemType == item.ListItemType.Item;
    //Here i'm finding the datalist inside the item of your  datalist
    Dim DataList dataList = item.FindControl("mydatalistID") as DataList;
   
    //Now you can work on the datalist inside that item in your other datalist. Just using the reference you //just did.
  // like this
   datalist.DataSource = mysource;
   datalist.DataBind();
}

Here you can take a better looking on how to get controls inside datalist:
http://forums.asp.net/thread/1596722.aspx
http://p2p.wrox.com/topic.asp?TOPIC_ID=8523
http://www.csharphelp.com/board2/read.html?f=1&i=49377&t=49377
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

704 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