Solved

Nested Datalists in vb.net

Posted on 2007-04-03
3
330 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
3 Comments
 
LVL 4

Accepted Solution

by:
Neotk earned 500 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

803 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