dropdown in child grid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dorandoran
    New Member
    • Feb 2007
    • 145

    dropdown in child grid

    I added a dropdown control in the child grid and now the regular header with sort not working for the column i added ddl. hmm, any idea?? (without the added ddl the sort works).
    Code:
    <asp:TemplateField HeaderText="Quantity " SortExpression="Quantity">
    <ItemTemplate><%# Eval("Quantity")%></ItemTemplate>
    <EditItemTemplate>
    <asp:TextBox ID="txtQuantity" Text='<%# Eval("Quantity")%>' runat="server"></asp:TextBox>
    </EditItemTemplate>
    <HeaderTemplate>
    <asp:Label runat=server ID="lblQty" Text="Quantity"  ></asp:Label>
                                                        
    
    <asp:DropDownList ID="ddlQuantity" runat="server" AutoPostBack=true >
    <asp:ListItem Text="30" Value="30" />
    <asp:ListItem Text="60" Value="60" />
    <asp:ListItem Text="90" Value="90" />
    </asp:DropDownList>
    </HeaderTemplate>                                                
    <FooterTemplate>
    <asp:TextBox ID="txtQuantity" Text='' runat="server"></asp:TextBox>
    </FooterTemplate>
                                                
    </asp:TemplateField>
    Last edited by Frinavale; Jun 16 '09, 03:44 PM. Reason: Added code tags. Please post code in [code] [/code] tags.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    The GridView will automatically convert header text into LinkButtons that it uses for sorting purposes when you do not specify your own custom HeaderTemplate.

    Since you require your own custom Header Template, then use the controls within this template to do your sorting instead of the GridView's Sort Event.

    Comment

    • dorandoran
      New Member
      • Feb 2007
      • 145

      #3
      Thank you sir. I got it work now.

      Comment

      Working...