Vignesh Kumar

Vignesh Kumar

  • NA
  • 1k
  • 416.3k

Retain dropdown values in gridview

Feb 6 2014 12:37 AM

Hi,

I have having a grid where I use checkbox to edit the grid rows. On checkbox click how can I retain the dropdown values?

Anu suggestions?

 <Columns>
    <asp:TemplateField>
       <HeaderTemplate>
           <asp:CheckBox ID="chkAll" runat="server" AutoPostBack="true" OnCheckedChanged="OnCheckedChanged" />
       </HeaderTemplate>
       <ItemTemplate>
          <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" OnCheckedChanged="OnCheckedChanged" />
       </ItemTemplate>
    </asp:TemplateField>

    <asp:TemplateField HeaderText="Scope">
       <HeaderStyle HorizontalAlign="Center" Wrap="False" CssClass="header">
       </HeaderStyle>
        <ItemTemplate>
           <asp:Label ID="lblScope" runat="server" Text='<%# Bind("Scope") %>'></asp:Label>
           <asp:DropDownList ID="ddlCMS" Visible="false" runat="server">
                    <asp:ListItem>Yes</asp:ListItem>
                    <asp:ListItem>No</asp:ListItem>
           </asp:DropDownList>
        </ItemTemplate>
        <ItemStyle Wrap="false" CssClass="header" />
    </asp:TemplateField>
 </Columns>


Answers (5)