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
110
InitializeDataSource fires before the datasource is prepared
posted

Pardon the newbie here but I can't get the WebGrid to work in LoadOnDemand mode.  I am binding to the datasource at runtime, triggered by a button click which calls a web service to retrieve the dataset.  The problem is that since the webgrid is on the .aspx page, I can't seem to effect when the InitializeDataSource event is fired.  Currently it fires before I can process the postback and generate the datasource.  How do I generate the dataset and then have it bound to the webgrid?

Parents
  • 28464
    posted

    Yes, in this case unfortunately I am not sure InitializeDataSource will do the job, since it is called early in the lifecycle after postback (before Page_Load) in order to restore the state of the grid. In Load On Demand scenarios you would most probably have to explicitly rebind the grid later on in the lifecycle, depending on the situation.

    I have found the following blog post by Tony Lombardo to be very very helpful in understanding how UltraWebGrid databinding works:

    http://blogs.infragistics.com/blogs/tony_lombardo/archive/2008/01/29/demystifying-infragistics-webgrid-databinding.aspx

    Also, you can check out our AJAX examples located here:

    http://samples.infragistics.com/2008.2/webfeaturebrowser/default.htm

    (in the AJAX - > WebGrid section). There are 8 samples with full source code demonstrating different AJAX / Load On Demand scenarios, so hopefully this will get you started. 

Reply Children