473,799 Members | 2,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nested Datalists

The application I'm creating consists of a DataGrid with 3 (at this
point in time) DataLists nested inside of it. One of the columns is for
the the latest version of the product and the other is for revisions to
that produce version. So the database table would look something like
this for any given item with revisions:

ItemNumber - Revision

A - 1
A - 2
B - 1
B - 2
B - 3
C - 1
D - 1
D - 2
D - 3
D - 4
etc - etc..

What I'm trying to figure out is if it is possible to have one column
with the Item Number (i.e. A) and the column next to it each Revision
of the Item (i.e. B1, B2, B3). I know it would probably be easiest to
create a function that gets the max Revision number and loop through it
to create a string.

<asp:DataList id="dl1" DataSource=<%#
GetItemInfo(Con tainer.DataItem ("ItemID")) %> Runat="server">
<HeaderTemplate >TEST</HeaderTemplate>
<ItemTemplate >
<%# Container.DataI tem("ItemName") %>
</ItemTemplate>
</asp:DataList>

This creates each a column that lists all Distinct Items:

A
B
C
D

How would I go about creating a column next to this one that writes A1,
A2, etc.. so that it looks like:

A - A1,A2
B - B1,B2,B3
C - C1
D - D1,D2,D3,D4

Any suggestions? If you are confused and need more information please
ask and I will provide.

Nov 19 '05 #1
5 1349
Nobody huh?

Nov 19 '05 #2
Hi,

Do a "select distinct(itemnu mber") from revisions" and make it the datasource
of the outer data control.

Define a relation between this result and the revison table on the Itembumber
column

Nest the inner data control after reading this article :
http://www.openmymind.net/index.aspx?documentId=8

Let me know if you have any more questions...

Cheers,
Tom Pester
The application I'm creating consists of a DataGrid with 3 (at this
point in time) DataLists nested inside of it. One of the columns is
for the the latest version of the product and the other is for
revisions to that produce version. So the database table would look
something like this for any given item with revisions:

ItemNumber - Revision

A - 1
A - 2
B - 1
B - 2
B - 3
C - 1
D - 1
D - 2
D - 3
D - 4
etc - etc..
What I'm trying to figure out is if it is possible to have one column
with the Item Number (i.e. A) and the column next to it each Revision
of the Item (i.e. B1, B2, B3). I know it would probably be easiest to
create a function that gets the max Revision number and loop through
it to create a string.

<asp:DataList id="dl1" DataSource=<%#
GetItemInfo(Con tainer.DataItem ("ItemID")) %> Runat="server">
<HeaderTemplate >TEST</HeaderTemplate>
<ItemTemplate >
<%# Container.DataI tem("ItemName") %>
</ItemTemplate>
</asp:DataList>
This creates each a column that lists all Distinct Items:

A
B
C
D
How would I go about creating a column next to this one that writes
A1, A2, etc.. so that it looks like:

A - A1,A2
B - B1,B2,B3
C - C1
D - D1,D2,D3,D4
Any suggestions? If you are confused and need more information please
ask and I will provide.

Nov 19 '05 #3
Thanks alot Tom. I am understanding the logic of that tutorial but the
only problem is that my page isn't in C# (I am currently learning
though =] ). What I have so far is:

strSQL = "SELECT Max(Sheet.DCN) AS MaxOfDCN, Max(ADCN.ADCN) AS
MaxOfADCN, " & _
"Sheet.SheetNum ber FROM Drawings INNER JOIN (ADCN INNER JOIN "
& _
"Sheet ON ADCN.RecordID = Sheet.RecordID) ON " & _
"Drawings.Drawi ng = Sheet.Drawing WHERE " & _
"(Sheet.Dra wing = '" & x & "') AND " & _
"(Sheet.SheetTy pe = 'CD') GROUP BY " & _
"Sheet.Draw ing, Sheet.SheetType , Sheet.SheetNumb er;"

This SQL statement returns all the information that I need (Drawing #,
SheetType, Version(DCN), Revisions(ADCN) , and SheetNumber). The DCN
(MaxOfDCN) is the most current version of that item and ADCN
(MaxOfADCN) is an integer that represents the number of revisions to
that current version of the item. I have utilized a function including
this SQL string as the DataSource for one of my datalists. The output
looks like:

COLUMN 1 - COLUMN 2 - COLUMN 3
Drawing #(string) - Most Current Item Version(string) - Number(n)

The function returns a dataset and the values from above are populated
in the datalist. What I'm wondering is if I could add a column to this
dataset and programmaticall y alter the output.

ds.Tables("Data Table").Columns .Add("NewColumn ") = strNewString

So let's say that COLUMN 2 = C and COLUMN 3 = 7, I would like to build
a string that looks like: C1,C2,C3,C4,C5, C6,C7

Can anyone get me started as to how to best (most efficiently) go about
doing this?

Much thanks.

Nov 19 '05 #4

You are asking for a specific solution and do it in not the best english
(its not bad though ;)

If you say how your input table(s) look like with significant data in it
and give the desired output (no need for html, just text and indentation)
I'll have a go at it.
Male the sample so that I see what the report is trying to do.
Cheers,
Tom Pester
Thanks alot Tom. I am understanding the logic of that tutorial but the
only problem is that my page isn't in C# (I am currently learning
though =] ). What I have so far is:

strSQL = "SELECT Max(Sheet.DCN) AS MaxOfDCN, Max(ADCN.ADCN) AS
MaxOfADCN, " & _
"Sheet.SheetNum ber FROM Drawings INNER JOIN (ADCN INNER JOIN
"
& _
"Sheet ON ADCN.RecordID = Sheet.RecordID) ON " & _
"Drawings.Drawi ng = Sheet.Drawing WHERE " & _
"(Sheet.Dra wing = '" & x & "') AND " & _
"(Sheet.SheetTy pe = 'CD') GROUP BY " & _
"Sheet.Draw ing, Sheet.SheetType , Sheet.SheetNumb er;"
This SQL statement returns all the information that I need (Drawing #,
SheetType, Version(DCN), Revisions(ADCN) , and SheetNumber). The DCN
(MaxOfDCN) is the most current version of that item and ADCN
(MaxOfADCN) is an integer that represents the number of revisions to
that current version of the item. I have utilized a function including
this SQL string as the DataSource for one of my datalists. The output
looks like:

COLUMN 1 - COLUMN 2 - COLUMN 3
Drawing #(string) - Most Current Item Version(string) - Number(n)
The function returns a dataset and the values from above are populated
in the datalist. What I'm wondering is if I could add a column to this
dataset and programmaticall y alter the output.

ds.Tables("Data Table").Columns .Add("NewColumn ") = strNewString

So let's say that COLUMN 2 = C and COLUMN 3 = 7, I would like to build
a string that looks like: C1,C2,C3,C4,C5, C6,C7

Can anyone get me started as to how to best (most efficiently) go
about doing this?

Much thanks.

Nov 19 '05 #5
Got mail Tom. Thanks again.

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2169
by: Greg Fischer | last post by:
I need to access the properties of a control that is nested in 2 datalists. How do you use findcontrol method to do that? what I have is like this: <asp:datalist id="dlist" runat="server"> <edititemtemplate> <asp:datalist id="dlistdet" runat="server"> <asp:dropdownlist id="ddlTypes" runat="server"></dropdownlist> </asp:datalist>
0
1219
by: Marty U. | last post by:
I have two datalists nested. On the ItemDataBound Event of the first datalist I databind the second with specific info. A couple questions: 1) How can I utilize the OnItemCommand of the nested datalist(inner) to retrieve the DataKey value when a user clicks a link button? 2) Is there anything I should be concerned with about ViewState? This is a reporting tool and no input is accepted. I have found a couple examples but none pointing...
0
354
by: schapopa | last post by:
I have two nested datalists and I am using percentage to make the width of the row: So my header of the parent datalist looks like this... <table><tr> <td width = 5%> <td width = 12%> <td width = 16%> <td width = 16%> <td width = 12%> <td width = 5%>
2
2396
by: Ole V.-M. | last post by:
Greetings, i have a UserControl, that contains a DataList. That DataList contains as items other DataLists. example: DataList A Row 1 Nested DataList 1 Row 1
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.