Posted on: 6/18/2013 3:47:01 AM | Views : 387

Hi, In my GridView I have a dropdown button(as item template). What i want is to show an other Gridview depending on the value of the DropDownList. I have tried with this codes....
the htmlcodes for the DropDownList:
<asp:TemplateField HeaderText="Status"> <ItemTemplate> <asp:DropDownList ID="DropDownList2" runat="server" OnTextChanged="itemChanged" AutoPostBack="True" > </asp:DropDownList> </ItemTemplate> in aspx.cs file :
protected void Page_Load(object sender, EventArgs e) { foreach (GridViewRow row in GridView1.Rows) { DropDownList ddl = (DropDownList)row.FindControl("DropDownList2"); ddl.Items.Add(" "); ddl.Items.Add("Single"); ddl.Items.Add("Combined"); } ...

Go to the complete details ...