iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
Could someone clarify how the AllowAutoDataCaching works? I have that enabled on my grid and I have the following event definition for the InitializeDataSource handler:
protected void Initas(object sender, DataSourceEventArgs e) { var cached = WebGrid1.IsDataCached(); if (!cached) { e.DataSource = CommonService.GetCountries(); WebGrid1.AddDataSourceToCache(e.DataSource); } }
But everytime that event executes (via postback or flypostback) I get WebGrid1.IsDataCached() = false.
Thanks
Attached is a simple sample that demonstrate the datasource is cached and show the rows count of the data source.
You will also need to have the global.asax file in your project in order to ensure caching works.
My test show in order to enable data caching in the WebGrid you will need to set the AllowAutoDataCaching to true. You will not need to use the AddDataSourceToCache function.
In order to retrieve the cached data please use GetCachedDataSource function.
Do you have a sample on this? I actually tried GetCachedDataSource() before. Even when I modify my IntiializeDataSource event to this I doesn't work.
protected void Initas(object sender, DataSourceEventArgs e)
{ var cachedDS = WebGrid1.GetCachedDataSource(); var cached = WebGrid1.IsDataCached(); if (!cached) e.DataSource = CommonService.GetCountries(); else e.DataSource = cachedDS; }
IsDataCached() keeps returning false. I have on my AllowAutoDataCaching="true" grid tag.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname