﻿<?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 - Custom VirtualLoadMode</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Custom-VirtualLoadMode/</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>Custom VirtualLoadMode</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Custom-VirtualLoadMode/</link><pubDate>Thu, 04 Sep 2014 22:19:19 GMT</pubDate><dc:creator>Hans</dc:creator><description>Hello,&lt;br&gt;&lt;br&gt;I apologize for my mistake.&lt;br&gt;&lt;br&gt;I mean, you could try to set the “LoadOnDemand” property (under &amp;lt;PreviewRowSettings&amp;gt; tag) to “False", not “true”.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Hans K.</description></item><item><title>Custom VirtualLoadMode</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Custom-VirtualLoadMode/</link><pubDate>Thu, 04 Sep 2014 07:11:21 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;Thanks Hans, please let me know of any updates. &amp;nbsp;By the way I am already using the LoadOnDemand = True property under the &amp;lt;PreviewRowSettings&amp;gt;&lt;/p&gt;</description></item><item><title>Custom VirtualLoadMode</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Custom-VirtualLoadMode/</link><pubDate>Wed, 03 Sep 2014 22:59:46 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br&gt;&lt;br&gt;Thank you for the reply.&lt;br&gt;&lt;br&gt;I have forward this issue the developer team under work item ASPNET-124.&lt;br&gt;I will let you about the update regarding this issue.&lt;br&gt;&lt;br&gt;However, to resolve this issue you could try to set the “LoadOnDemand” property (under &amp;lt;PreviewRowSettings&amp;gt; tag) to “True".&lt;br&gt;&lt;br&gt;Hope this helps.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Hans K.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Custom VirtualLoadMode</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Custom-VirtualLoadMode/</link><pubDate>Wed, 03 Sep 2014 06:55:28 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>Hans,&lt;br&gt;&lt;br&gt;&amp;nbsp; Yes that is basically the same error I get.&amp;nbsp; "Object Reference not set to an instance of an object"&lt;br&gt;</description></item><item><title>Custom VirtualLoadMode</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Custom-VirtualLoadMode/</link><pubDate>Wed, 03 Sep 2014 05:20:44 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br&gt;&lt;br&gt;I apologize for any inconvenience this problem may have caused you.&lt;br&gt;&lt;br&gt;Based on your information, I tried to investigate this issue with WebGrid sample, named VirtualLoadwithCustomLoadonDemand.aspx page.&lt;br&gt;I modified the WebGrid’s configuration so that similar with your current scenario.&lt;br&gt;In &amp;lt;RootTable&amp;gt; tag, I set the PreviewRowVisible property to "True".&lt;br&gt;In &amp;lt;PreviewRowSettings&amp;gt; tag, I set the DefaultExpanded property to " False" &amp;amp; LoadOnDemand property to "True". (I attached the modified page as well)&lt;br&gt;&lt;br&gt;Like you did, I got the error message while trying to expand the preview row on 51st (or above).&lt;br&gt;Did you get the same / similar error message (PreviewRow_ErrorMessage.png)?&lt;br&gt;If no, could you provide me information regarding your error message?&lt;br&gt;&lt;br&gt;Thank you for your help.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Hans K.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Custom VirtualLoadMode</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Custom-VirtualLoadMode/</link><pubDate>Tue, 02 Sep 2014 09:45:23 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;In my grid I have the following settings:&lt;/p&gt;&lt;p&gt;&amp;lt;LayoutSettings AllowFilter="Yes" AllowGrouping="Yes" AllowSorting="Yes" PagingMode="VirtualLoad"&lt;br&gt; VirtualLoadMode="Custom" GroupByBoxVisible="False" AllowColumnFreezing="No" AllowColumnMove="Yes"&lt;br&gt; AllowExport="Yes" AlwaysShowHelpButton="false" AllowSelectColumns="Yes" RowLostFocusAction="NeverUpdate"&lt;br&gt; AutoFilterSuggestion="True" FilterBarVisible="false" HideColumnsWhenGrouped="No"&lt;br&gt; InProgressUIBehavior="ChangeCursorToHourGlass" PagingSize="50" ShowFilterStatus="True"&lt;br&gt; RestoreRowSelection="RootTableOnly" VirtualPageSize="50" PagingExportMode="ExportAllData"&lt;br&gt; AllowMultipleSelection="No" GroupRowInfoFormatDefault="[caption] : [value] ([count])"&lt;br&gt; ColumnFooters="Yes" HeaderClickAction="SortSingle" ShowColumnAction="true" RowHeaders="No"&lt;br&gt; CellClickAction="CellSelect" AutoFitColumns="false"&amp;gt;&lt;/p&gt;&lt;p&gt;In the InitializeDataSource event, I get the SortExpression and maxRows and pass those to my database class, so when I display the grid, I see the first 50 rows and I can load more rows 50 at a time with no problems. The problems comes when I load a preview row. The preview row is loaded on demand. Now if I view any of the first 50 rows then I have no problems viewing the preview row, but if I try to view the preview row on the 51st row then I get an error. It appears the problem is the StartRow, is there a way to determine what the StartRow is? A work around is to load the entire recordset but that defeats the purpose of VitualLoading and when you &lt;br&gt;return 120K records, it takes a while.&lt;/p&gt;&lt;p&gt;So is there a way to determine what the StartRow is for the page you are on or a way to determine the row that &lt;br&gt;you want to preview and only get that data? The preview row actually is data that is contained in hidden &lt;br&gt;columns of the grid, but formatted differently.&lt;/p&gt;&lt;p&gt;thanks john&lt;br&gt;&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
    {
        RDRDetails db = new RDRDetails();
        getSearchCriteria();

        string sortExpression = "";
        if (WebGrid1.RootTable.SortedColumns.Count &amp;gt; 0)
        {
            sortExpression = WebGrid1.RootTable.SortedColumns.GetSortExpression();
            sortExpression = sortExpression.Replace("]", "").Replace("[", "");// String.Replace(String.Replace(sortExpression, "]", ""), "[", "");
        }

        int startRows = 0;
        int maxRows = WebGrid1.VirtualLoadArgs.RequestedRows;
        int intRDRCount = GetRDRCount();

        WebGrid1.VirtualLoadArgs.TotalDataSourceRows = intRDRCount;

        if (WebGrid1.FlyPostBackAction == PostBackAction.Export)
        {
            //max 10,000 rows when exporting the grid
            e.DataSource = GetRDRs(startRows, 10000, sortExpression);
        }
        else if (WebGrid1.FlyPostBackAction == PostBackAction.LoadPreviewRow)
        {
            e.DataSource = GetRDRs(startRows, maxRows, sortExpression);     // This loads every record not the maxrows, it should be getting one!
        }
        else
        {&lt;/pre&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description></item></channel></rss>