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(Container.DataItem("ItemID")) %> Runat="server">
<HeaderTemplate>TEST</HeaderTemplate>
<ItemTemplate>
<%# Container.DataItem("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. 5 1333
Hi,
Do a "select distinct(itemnumber") 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(Container.DataItem("ItemID")) %> Runat="server"> <HeaderTemplate>TEST</HeaderTemplate> <ItemTemplate> <%# Container.DataItem("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.
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.SheetNumber FROM Drawings INNER JOIN (ADCN INNER JOIN "
& _
"Sheet ON ADCN.RecordID = Sheet.RecordID) ON " & _
"Drawings.Drawing = Sheet.Drawing WHERE " & _
"(Sheet.Drawing = '" & x & "') AND " & _
"(Sheet.SheetType = 'CD') GROUP BY " & _
"Sheet.Drawing, Sheet.SheetType, Sheet.SheetNumber;"
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 programmatically alter the output.
ds.Tables("DataTable").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.
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.SheetNumber FROM Drawings INNER JOIN (ADCN INNER JOIN " & _ "Sheet ON ADCN.RecordID = Sheet.RecordID) ON " & _ "Drawings.Drawing = Sheet.Drawing WHERE " & _ "(Sheet.Drawing = '" & x & "') AND " & _ "(Sheet.SheetType = 'CD') GROUP BY " & _ "Sheet.Drawing, Sheet.SheetType, Sheet.SheetNumber;" 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 programmatically alter the output.
ds.Tables("DataTable").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.
Got mail Tom. Thanks again. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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">...
|
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...
|
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%>...
|
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
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |