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
In my grid I have the following settings:
<LayoutSettings AllowFilter="Yes" AllowGrouping="Yes" AllowSorting="Yes" PagingMode="VirtualLoad" VirtualLoadMode="Custom" GroupByBoxVisible="False" AllowColumnFreezing="No" AllowColumnMove="Yes" AllowExport="Yes" AlwaysShowHelpButton="false" AllowSelectColumns="Yes" RowLostFocusAction="NeverUpdate" AutoFilterSuggestion="True" FilterBarVisible="false" HideColumnsWhenGrouped="No" InProgressUIBehavior="ChangeCursorToHourGlass" PagingSize="50" ShowFilterStatus="True" RestoreRowSelection="RootTableOnly" VirtualPageSize="50" PagingExportMode="ExportAllData" AllowMultipleSelection="No" GroupRowInfoFormatDefault="[caption] : [value] ([count])" ColumnFooters="Yes" HeaderClickAction="SortSingle" ShowColumnAction="true" RowHeaders="No" CellClickAction="CellSelect" AutoFitColumns="false">
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 return 120K records, it takes a while.
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 you want to preview and only get that data? The preview row actually is data that is contained in hidden columns of the grid, but formatted differently.
thanks john
protected void WebGrid1_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e) { RDRDetails db = new RDRDetails(); getSearchCriteria(); string sortExpression = ""; if (WebGrid1.RootTable.SortedColumns.Count > 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 {
Hello,I apologize for any inconvenience this problem may have caused you.Based on your information, I tried to investigate this issue with WebGrid sample, named VirtualLoadwithCustomLoadonDemand.aspx page.I modified the WebGrid’s configuration so that similar with your current scenario.In <RootTable> tag, I set the PreviewRowVisible property to "True".In <PreviewRowSettings> tag, I set the DefaultExpanded property to " False" & LoadOnDemand property to "True". (I attached the modified page as well)Like you did, I got the error message while trying to expand the preview row on 51st (or above).Did you get the same / similar error message (PreviewRow_ErrorMessage.png)?If no, could you provide me information regarding your error message?Thank you for your help.Regards,Hans K.
Hello,Thank you for the reply.I have forward this issue the developer team under work item ASPNET-124.I will let you about the update regarding this issue.However, to resolve this issue you could try to set the “LoadOnDemand” property (under <PreviewRowSettings> tag) to “True".Hope this helps.Regards,Hans K.
Thanks Hans, please let me know of any updates. By the way I am already using the LoadOnDemand = True property under the <PreviewRowSettings>
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