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
20
Stop the WebDataGrid from sorting but keep the events wired up
posted

I'm using a WebDataGrid (2010 v1) with custom code that invokes a webservice that fetches, filters, sorts and sends back paging information. I subscribe to the "OnColumnSorted" event of the grid to fetch the newly sorted data from the webservice. I then bind the returned results to the grid but find out that the grid does another sort on top of the one I already applied in the webservice. My goals are the keep the grid wired up so that clicking a column header wil indeed invoke the "OnColumnSorted" event and will display the appropriate sort icon but I don't want the grid to actually do the sorting when I call DataBind(). How can this be accomplished?

I've tried clearing all of the sort columns prior to the call to DataBind(). This does indeed stop the sorting but removes the sort indicator on the UI. I tried adding the columns back to the sorted columns after the databind but then the grid still tries to apply it's sort even though DataBind() has already been invoked.