Master - Detail with asp:GridView with no client interaction

Discussion in '.NET' started by davidd, Sep 5, 2006.

  1. davidd

    davidd

    Joined:
    Sep 5, 2006
    Messages:
    1
    Hi,

    with the code below I want to use one gridview in another to show a master-detail-relation.
    Whe I run the script I see only the first GridView but not the second.

    Can someone tell me what to do to get both, please.

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" ShowHeader="False" CellPadding="2" GridLines="None" datakeynames="category_guid">
    <Columns>
    <asp:TemplateField ShowHeader="False" SortExpression="date_start">
    <ItemTemplate>
    <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "category")%>'></asp:Label>
    <ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField ShowHeader="False" SortExpression="date_start">
    </ItemTemplate>
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource2" ShowHeader="False" CellPadding="2" GridLines="None" datakeynames="category_guid">
    <Columns>
    <asp:TemplateField ShowHeader="False" SortExpression="date_start">
    <ItemTemplate>
    <asp:Label ID="Label1" runat="server" Text='<%# Bind("date_start", "{0:dd.MM.yy}") %>'></asp:Label>
    </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField>
    <ItemTemplate>
    <a href="javascript:eek:penPopup('EventsPopup.aspx?guid=<%# Eval("event_guid") %>', '600', '465', 'events_details')"><%# Eval("title") %></a>
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:FHBConnectionString %>"
    SelectCommand="SELECT [web_event_categories].[category], [web_events].[event_guid], [web_events].[date_start], [web_events].[title] FROM [web_event_categories], [web_events] WHERE (([web_events].[date_start] > getdate()) AND ([web_events].[hide] = 0) AND ([web_events].[category_guid] = [web_event_categories].[category_guid]) AND [web_event_categories].[category_guid] = @kategorie) ORDER BY [web_event_categories].[category] ASC, [web_events].[date_start] ASC">
    <SelectParameters>
    <asp:ControlParameter Name="kategorie" ControlId="GridView1" PropertyName="SelectedValue" />
    </SelectParameters>
    </asp:SqlDataSource>
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:FHBConnectionString %>"
    SelectCommand="SELECT [category_guid], [category] FROM [WEB_EVENT_CATEGORIES]">
    </asp:SqlDataSource>

    (
    Ther result should look about somethilg like that:
    HEADER
    DETAIL
    DETAIL
    HEADER
    DETAIL
    DETAIL
    DETAIL

    )

    With kind regards,
    David
    davidd, Sep 5, 2006
    #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. Q. John Chen
    Replies:
    0
    Views:
    340
    Q. John Chen
    Nov 15, 2006
  2. Q. John Chen
    Replies:
    0
    Views:
    302
    Q. John Chen
    Nov 15, 2006
  3. asmj
    Replies:
    0
    Views:
    492
  4. Arun Kumar Menon

    Master Detail detail

    Arun Kumar Menon, Aug 6, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    188
    Arun Kumar Menon
    Aug 6, 2003
  5. Frederik Borg

    ASp.net data binding: Master-detail-detail

    Frederik Borg, Jun 9, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    349
    Frederik Borg
    Jun 9, 2006
Loading...

Share This Page