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
720
Clear Selected Rows Server Side / Clear DataSource
posted

I am currently using the WebHierarchicalDataGrid for a project and need to be able to clear the row selection (only one row may be selected at a time) and also clear the data source. The WebDataGrid has a function called ClearDataSource for clearing the data source and clearing the selected rows works as it should.

I tried a couple of ways - first just calling grid.Behaviors.Selection.SelectedRows.Clear() directly at the point where I need it to occur and that did not work. Then I tried setting a boolean at the point in the code where I need the selection to be cleared and then checking this value in the grid's Pre-Render Event. When I step through the code in the debugger, everything appears to be working - but the grid still has the previously selected row highlighted. We are currently using version 11.1.20111.2020.

Also, I need to be able to clear the datasource as well. But I can not find a function to do this. I have been forced to bind it to an empty dataset (very memory intensive).

 Does another post exist which already answers this question? Any input would sure be appreciated.

Thanks,

Parents
No Data
Reply
  • 720
    posted

    Update...

    I found documentation and read it (that's always a good idea I guess...) and was able to clear the selection of the parent band by calling grid.GridView.Behaviors.Selection.SelectedRows.Clear(). I also found grid.GridView.ClearDataSource() which appears to clear all of the data out of the grid.

    Thanks,

Children
No Data