table web control

Discussion in 'ASP .Net Web Controls' started by -D-, Nov 4, 2004.

  1. -D-

    -D- Guest

    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-
    -D-, Nov 4, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    718
  2. David Williams
    Replies:
    2
    Views:
    1,122
    Jacob Yang [MSFT]
    Aug 12, 2003
  3. Rio
    Replies:
    4
    Views:
    1,187
  4. Geary
    Replies:
    2
    Views:
    719
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jul 12, 2007
  5. Symphony

    add hyber link to table or table cell web control

    Symphony, Mar 15, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    386
    Ken Cox [Microsoft MVP]
    Mar 16, 2005
Loading...

Share This Page