Reputation: 581
I have a gridview inside an updatepanel. It has a TemplateField column with radiobutton:
<asp:GridView ID="gridView_stLists" runat="server" AutoGenerateColumns="False" CellPadding="3"
BorderStyle="NotSet" CssClass="table_layout" Width="500">
<RowStyle CssClass="table_body" />
<Columns>
<asp:TemplateField HeaderStyle-Width="20">
<ItemTemplate>
<asp:RadioButton ID="rdBtn_stdl" runat="server"
oncheckedchanged="rdBtn_stdl_CheckedChanged" AutoPostBack="True"
GroupName="stdl" value='<%# Eval("uri") %>'/>
</ItemTemplate>
<HeaderStyle Width="20px" />
</asp:TemplateField>
And i have the eventhandler for CheckedChanged. My problem is, firstly, with autopostback true, when I select radio in grid, selection disapears. Secondly, with autopostback true or false, the eventhandler is not fired. Could you please help in this situation
Upvotes: 1
Views: 1489
Reputation: 116977
My guess is that you are rebinding the gridview on your postback, which will screw up the association of eventhandlers to templates for certain controls. If you could post some code it would be easier to help though.
You might also see an answer I posted to a similar issue here to give you some ideas: LinkButton command event seems to not be firing
Upvotes: 1