Solved

Nested Datalists in vb.net

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Save ms data to server side. 19 56
How to seperate number and letters from a string 3 22
Vb.net threads keep increasing 2 37
Groupbox Control ? 2 19
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

820 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