Link to home
Create AccountLog in
Avatar of propractice
propractice

asked on

Custom User Control Functionality Inside a Table or GridView

My assistant and I are programming an ASP.NET website, and I have a feature specification that I want to implement but I'm uncertain as to how to do so within my parameters.

I want my feature to be a grid view or table and I would like it to do these things:

(I work for a university, so I'll include the people specifications)
Display student information (first/last name), quarter and year, and a status light (red/yellow/green/gray depending on data returned in a query) all on one row.  Somewhere in this same row I would want a clickable link (preferably on the student last/first name) that expands/shows a panel underneath that holds some data from the SQL query.  I want to use a grid view or table so I can use its built in sorting mechanisms, and I don't want to involve myself with manufacturing a table from scratch(TableRow tr = new TableRow, et cetera).  I'd prefer some guidance on doing this with a custom user control if its possible that way, but alternative solutions are accepted.


Collapsed Form
==========================
Last, First | Quarter | Year | Light
Last, First | Quarter | Year | Light
Last, First | Quarter | Year | Light

Expanded Form
==========================
Last, First | Quarter | Year | Light
  Data Value | Data Value
  Data Value | Data Value
Last, First | Quarter | Year | Light
Last, First | Quarter | Year | Light
  Data Value | Data Value
  Data Value | Data Value
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

That sounds like a GridView with a TemplateField that has a inner GridView defined:


        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="AddressID"
            DataSourceID="ObjectDataSource1">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:GridView ID="GridView2" runat="server">
                        </asp:GridView>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of propractice
propractice

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account