D
-D-
I'm pretty new to using asp.net, so please forgive my novice question. I
hope I clearly explain myself.
I'm trying to do the following with a table web control. I want to have a
table with headers that are sortable for each column and then another row
where the fields from a database will be populated....say 4 columns.
I want to repeat the table row where the data is populated. So, a new row
will be dynamically generated for every row in the database table that I'm
pulling data from.
The first table row where I have the headers remain static, but have the
capability to sort each column of data.
The other functionality I would like is to be able to click on a row
containing data and it will then display another table below that will hold
all the fields for that particular record. So, the funtionality would have
the ability to click a row and show another table kind of like a show/hide
region in ASP and display all the fields in the database table for the
corresponding record that was clicked in the top table.
I hope I explained that clearly. How could I achieve this? Would I program
this in the code behind? I'm using C#.
This is the basic idea I was working with:
<asp:Table id="Table1"
BackImageUrl="url"
CellSpacing="cellspacing"
CellPadding="cellpadding"
GridLines="None|Horizontal|Vertical|Both"
HorizontalAlign="Center|Justify|Left|NotSet|Right"
runat="server">
<asp:TableRow>
<asp:TableCell>Header1</asp:TableCell>
<asp:TableCell>Header2</asp:TableCell>
<asp:TableCell>Header3</asp:TableCell>
<asp:TableCell>Header4</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>Field1</asp:TableCell>
<asp:TableCell>Field2</asp:TableCell>
<asp:TableCell>Field3</asp:TableCell>
<asp:TableCell>Field4</asp:TableCell>
</asp:TableRow>
</asp:Table>
<asp:Table id="Table2" (gets displayed when a row in table1 is clicked)
BackImageUrl="url"
CellSpacing="cellspacing"
CellPadding="cellpadding"
GridLines="None|Horizontal|Vertical|Both"
HorizontalAlign="Center|Justify|Left|NotSet|Right"
runat="server">
<asp:TableRow>
<asp:TableCell>blahblah</asp:TableCell>
<asp:TableCell>etc.</asp:TableCell>
</asp:TableRow>
</asp:Table>
Any help is greatly appreciated. Thank you.
-D-
hope I clearly explain myself.
I'm trying to do the following with a table web control. I want to have a
table with headers that are sortable for each column and then another row
where the fields from a database will be populated....say 4 columns.
I want to repeat the table row where the data is populated. So, a new row
will be dynamically generated for every row in the database table that I'm
pulling data from.
The first table row where I have the headers remain static, but have the
capability to sort each column of data.
The other functionality I would like is to be able to click on a row
containing data and it will then display another table below that will hold
all the fields for that particular record. So, the funtionality would have
the ability to click a row and show another table kind of like a show/hide
region in ASP and display all the fields in the database table for the
corresponding record that was clicked in the top table.
I hope I explained that clearly. How could I achieve this? Would I program
this in the code behind? I'm using C#.
This is the basic idea I was working with:
<asp:Table id="Table1"
BackImageUrl="url"
CellSpacing="cellspacing"
CellPadding="cellpadding"
GridLines="None|Horizontal|Vertical|Both"
HorizontalAlign="Center|Justify|Left|NotSet|Right"
runat="server">
<asp:TableRow>
<asp:TableCell>Header1</asp:TableCell>
<asp:TableCell>Header2</asp:TableCell>
<asp:TableCell>Header3</asp:TableCell>
<asp:TableCell>Header4</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>Field1</asp:TableCell>
<asp:TableCell>Field2</asp:TableCell>
<asp:TableCell>Field3</asp:TableCell>
<asp:TableCell>Field4</asp:TableCell>
</asp:TableRow>
</asp:Table>
<asp:Table id="Table2" (gets displayed when a row in table1 is clicked)
BackImageUrl="url"
CellSpacing="cellspacing"
CellPadding="cellpadding"
GridLines="None|Horizontal|Vertical|Both"
HorizontalAlign="Center|Justify|Left|NotSet|Right"
runat="server">
<asp:TableRow>
<asp:TableCell>blahblah</asp:TableCell>
<asp:TableCell>etc.</asp:TableCell>
</asp:TableRow>
</asp:Table>
Any help is greatly appreciated. Thank you.
-D-