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
200
Label text not updating during OnRowSelectionChanged event
posted

I have a WebDataGrid with the OnRowSelctionChanged event configured.  In that event, I use server-side code to update the text on a label outside the grid.  I can see the lbl.Text value getting set on the server side, but it is not getting updated on the client side.

I have tried these approaches:

  • Put the grid and label inside an ASP Update Panel
  • Don't use an UpdatePanel, but set EnableAjax and EnableAjaxViewState to True on the WebDataGrid.
  • Use a standard postback without the two above bullet points (no AJAX).

Is there anything I need to do to allow this event to update controls outside of the WebDataGrid?  If I run the same code using a standard ASP Button click (outside the grid), the label gets update appropriately.  So I must be misunderstanding something about the WebDataGrid event handling.

  • 7375
    Offline posted

    Hello Adrian, 

    In the WebDataGrid during OnRowSelectionChanged event to set the label, you have to set ‘EnableAjax’ property to false to cause a full page postback in the page. 

    To call the server method on the client side event ,you can handle the client side rowselectionchanged event and trigger a postback in this event like this: 

    function WebDataGrid1_Selection_RowSelectionChanged(sender, eventArgs) {
                if (eventArgs.getSelectedRows().get_length() > 0) {
                    __doPostBack('<%= WebDataGrid1.ClientID %>', '');
                }
            }
     

    You can also refer the below post for more information: 

    https://www.infragistics.com/community/forums/p/91681/453216.aspx#453216 

    You can also refer the below online sample: 

    https://www.infragistics.com/samples/aspnet/data-grid/selection-server-events

     

    Please let me know if you need further assistance.