Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
95
Server event for templated column not being triggered?
posted

I have a templated columns with a radibutton control in a webgrid.

 <igtbl:TemplatedColumn>                          
 <CellTemplate><asp:RadioButton ID="chkDel" runat="server" OnClick="SelectSingleRow(this);" OnCheckedChanged="RadioButton1_CheckedChanged"/></CellTemplate>
</igtbl:TemplatedColumn>

I do not see the OnCheckedchanged event being triggered. What should i do to resolve this?

 

Parents
No Data
Reply
  • 14049
    Offline posted

    It depends on how the grid is bound. If you are using the InitializeDataSource event, or a data source control, then the grid rebinds on every post back.You might want to consider to enable the ViewState for the grid rows by not using those methods of data binding, but rather do it the old fashioned way:

    if(!this.IsPostBack)

    {

      grid.DataSource=datasource;

      grid.Databind()

    }

    That way on a post back the rows will be restored from the ViewState and the templates will be initialized properly, so the event will find its way.

Children
No Data