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:
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.
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://es.infragistics.com/community/forums/p/91681/453216.aspx#453216
You can also refer the below online sample:
https://es.infragistics.com/samples/aspnet/data-grid/selection-server-events
Please let me know if you need further assistance.