tags:

views:

378

answers:

1

Hi, 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

+1  A: 

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: http://stackoverflow.com/questions/735777/linkbutton-command-event-seems-to-not-be-firing/735974#735974

womp
Thank you very much. I've spent 3 hours searching. I wish I'd posted here earlier.thank you very much again
Ehsan