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?
Thanks for the follow-up. In this case I believe that our KB section of DevCenter has most of the information you need, with detailed comments and code samples
You can reach the KB / DevCenter here
http://devcenter.infragistics.com/Support/KnowledgeBaseResults.aspx?type=Full&query=&platform=4&component=5&articletypes=0&age=0&sort=LastModifiedDate&samplesonly=0
and filter all the results for databinding / DataSet / AJAX, etc
Can you point me to examples with comments (webgird, gauges, charts)? Your samples page has no explanations of how to implment the features so I'm left trying to figure it out on my own and I'm not having much luck. I must not be looking for documentation in the right place because it doesn't make sense to show samples of what can be done without explaining how to do it. Your online "help" has plenty of API reference but no in-depth code tutorials that I could find.
Right now I have a grid displaying 20 rows with no vertical scrollbar so I'm not sure if the scroll-on-demand is working (where are the other 3000+ rows from my dataset?). I blindly cut and pasted code from the sample without knowing how it all works. I need a fully functioning example (including both the .aspx code and the .aspx.cs code-behind) to load a dataset from a webservice (triggered by a button click) at runtime and implement load on demand and scroll on demand. I'd also like an example of how to implement paging should I decide to go that route rather than scroll on demand.
I also have a problem in that when I try to drag columns around, the grid disappears. Do I have to cache the dataset and reload it? If so, how do I manage the paging so that the correct page is displayed? Where is this all documented?
Thanks...
On an unrelated note, the treeview in your online help does not produce a scrollbar in FireFox 3, so opening the tree causes some nodes to be unviewable without closing nodes above or scrolling the whole page...
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.