Solved

Nested Datalists in vb.net

Posted on 2007-04-03
3
333 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 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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 …
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…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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