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
100
Clientside ColumnSorted event not firing
posted

Hi,

First off, i'm working with ASP.Net 2.0 WebDataGrid Version 9.1.20091.2087

I am trying to programmatically assign a javascript function to the ColumnSorted and DataFiltered events when the webdatagrid is initialised, the problem is that it never gets called when I sort or filter the grid in the browser. Below is my code.

 function addWebDataGrid(grid, args) {
   var ev = grid.get_behaviors().getBehaviorByName('Sorting').get_events();   
   ev.addHandler('ColumnSorting', showSomething);
   ev.addHandler('ColumnSorted', hideSomething);    //Is not firing

   ev = grid.get_behaviors().getBehaviorByName('Filtering').get_events();
   ev.addHandler('DataFiltering', showSomething);
   ev.addHandler('DataFiltered', hideSomething);     //Is not firing
}

As you can see I also want to handle the ColumnSorting and DataFiltering events, which work perfectly and as expected.
Also note that I have tried manually adding the "hideSomething" function to the ColumnSorted and DataFiltered properties in the Visual Studio designer and they work as expected, its just programmatically adding the events that is not working.

Am I doing anything wrong?