Click here to Skip to main content
15,905,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using gridview
I have column one in dropdownlist and column2 is label.

when i select my dropdown, i want to display my values in the lable based on my gridview dropdown selected index changed..

what event need to use for this..?
Posted

1 solution

create a event handler like below :

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
// your code
}

then attach the event handler to the dropdownlist like shown below:

<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true"
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900