﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Cached Data Source?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cached-Data-Source/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Cached Data Source?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cached-Data-Source/</link><pubDate>Tue, 06 Apr 2010 22:58:05 GMT</pubDate><dc:creator>Glayaar</dc:creator><category>WebGrid</category><description>&lt;p&gt;Attached is a simple sample that demonstrate the datasource is cached and show the rows count of the data source.&lt;/p&gt;&lt;p&gt;You will also need to have the global.asax file in your project in order to ensure caching works.  &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Cached Data Source?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cached-Data-Source/</link><pubDate>Tue, 06 Apr 2010 09:59:51 GMT</pubDate><dc:creator>Gmontes</dc:creator><category>WebGrid</category><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;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. &lt;/p&gt;
&lt;p&gt; &lt;span class="Apple-style-span" style="font-family: 'courier new', tahoma; font-size: 12px; white-space: pre; "&gt;protected void Initas(object sender, DataSourceEventArgs e)&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;        {
            var cachedDS = WebGrid1.GetCachedDataSource();
            var cached = WebGrid1.IsDataCached();
            if (!cached)
                e.DataSource = CommonService.GetCountries();
            else
                e.DataSource = cachedDS;
        }&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;IsDataCached() keeps returning false. I have on my AllowAutoDataCaching="true" grid tag.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>Cached Data Source?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cached-Data-Source/</link><pubDate>Tue, 06 Apr 2010 00:33:18 GMT</pubDate><dc:creator>Glayaar</dc:creator><category>WebGrid</category><description>&lt;p&gt;My test show in order to enable data caching in the WebGrid you will need to set the &lt;em&gt;AllowAutoDataCaching&lt;/em&gt; to true. You will not need to use the AddDataSourceToCache function.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In order to retrieve the cached data please use &lt;em&gt;GetCachedDataSource&lt;/em&gt; function.&lt;/p&gt;</description></item><item><title>Cached Data Source?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cached-Data-Source/</link><pubDate>Mon, 05 Apr 2010 18:02:49 GMT</pubDate><dc:creator>Gmontes</dc:creator><category>WebGrid</category><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;protected void Initas(object sender, DataSourceEventArgs e)
        {
            var cached = WebGrid1.IsDataCached();
            if (!cached)
            {
                e.DataSource = CommonService.GetCountries();
                WebGrid1.AddDataSourceToCache(e.DataSource);
            }
        }&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;But everytime that event executes (via postback or flypostback) I get WebGrid1.IsDataCached() = false.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p /&gt;</description></item></channel></rss>