Is it possible to set ViewState=False and still handle Server Side grid events? If I disable Viewstate my grid idoes almost everything I want except it no longer handles the Cell Click event (the grid goes blank). I would have thought this was possible as long as the Click event was wired up as part of the grid initialisation each time, however I can't see how to do that.
I know about saving ViewState on the Server so that is what I am currently doing to reduce the page size.
Hello
Yes, I believe this is the expected behaviour since ViewState takes care of server-state / events and switching it of will prevent any state / events to fire, even if you rebind the grid prior to that.
The solution here would probably revolve around client-side event in the CSOM, for example you can hook the client-side CellClick event documented here
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR3.5/html/WebGrid_Client_Side_Events_CSOM.html
and in the javascript event handler you can update a hidden field with the id of the cell / row clicked. After posting back you will have this information in the hidde field and can process it on the server in any event needed, so no need for server side post event here.
Putting the code to build my grid in InitializeDataSource changes what happens but the Click event is still not called.
My Grid is effectively recreated on each call. A user control is called on Page Load and this triggers an event which fills the Grid. It is an unbound grid with a single Band and all rows and columns are added to the grid.
You say that the band and columns must be defined in the aspx. The aspx has the default rump grid but all rows are removed and then new rows added each time. Is that my problem? As I said the Click event fires with ViewState enabled but in this case when the Postback happens the code to recreate the grid is not called.