C# .NET - please help - Asked By selva kumar on 16-Jul-12 05:35 AM

my proj i am using  drop down list box placed within grid view control .. how to get list data in retrive sql server  select index change event .. please provide a solution for me
Jitendra Faye replied to selva kumar on 16-Jul-12 09:36 AM
Implement your code like this-


<asp:TemplateField ItemStyle-Font-Bold="true">
          <ItemTemplate>
            <asp:DropDownList ID="drp" runat="server" OnTextChanged="drp_SelectedIndexChanged"
              OnSelectedIndexChanged="drp_SelectedIndexChanged" AutoPostBack="true">
              <asp:ListItem>1 </asp:ListItem>
              <asp:ListItem>2 </asp:ListItem>
            </asp:DropDownList>
           </ItemTemplate>
        </asp:TemplateField>

in code behind-

protected void drp_SelectedIndexChanged(object sender, EventArgs e)
    {
      //Your code
    }