Hello,I have two webgrid, depending on a checkbox, one is visible and the other one is not visible.However, the event DataBinding is hit for both grid all the time which is not good for the performance.When I debug my code I can see that it always go first to the databinding event and then to the "Checkchanged" event of my checkbox where I set the visibility of each grid to true or false.How can I prevent a grid from databinding?Thanks
If you don't want to databind WebGrid, you need to avoid doing three things:
Thanks for your quick answer.I tried not to use the grid's DataSourceID property at design-time and mannual set it up in the code behind in the page_load. But by doing that, my event initialirow can not find any reference to the columns.
For example e.Layout.Bands[0].Columns.FromKey("revlevel").Width = Unit.Pixel(10);This will create an error if I set up the DatasourceID in the code behindThanks