Hi,
we have a customized webdatagrid with 20 columns per row and have around 1200 rows to display. its taking around 45 seconds to load the entire data and display it to user. Since this grid is on the Homepage of the site. the home page loading is also very slow. we are using Webdatagrid V12.2
<asp:Panel ID="Panel" runat="server"> <ig:WebDataGrid ID="UltraWebGrid" runat="server" OnInitializeRow="UltraWebGrid_InitializeRow" EnableRelativeLayout="false" HeaderCaptionCssClass="GridHeaderCaption" OnInit="UltraWebGrid_Init" OnRowUpdated="UltraWebGrid_RowUpdated" OnRowUpdating="UltraWebGrid_RowUpdating" OnColumnMoved="UltraWebGrid_ColumnMoved" EnableAjax="true" EnableAjaxViewState="true" EnableDataViewState="True" OnColumnResized="UltraWebGrid_ColumnResized" OnColumnSorted="UltraWebGrid_ColumnSorted" > <Behaviors> <ig:Sorting> </ig:Sorting> <ig:ColumnMoving EnableInheritance="True"> </ig:ColumnMoving> <ig:Filtering FilterType="ExcelStyleFilter"> </ig:Filtering> <ig:ColumnResizing Enabled="true"> <ColumnSettings> <ig:ColumnResizeSetting EnableResize="true" /> </ColumnSettings> </ig:ColumnResizing> <ig:EditingCore AutoCRUD="false"> <EditingClientEvents CellValueChanged="UltraWebGrid_Editing_CellValueChanged" /> <Behaviors> <ig:CellEditing> <CellEditingClientEvents /> <EditModeActions EnableOnActive="True" MouseClick="Single" /> </ig:CellEditing> </Behaviors> </ig:EditingCore> </Behaviors> </ig:WebDataGrid> </asp:Panel>
Any Idea on how to speed this up? can we use Asyncscroll/Paging or any other property of the grid to initially load few records and then get some more in background asynchronously and improve the speed of the Page/application?
Thanks,
Hello,
You can use the Paging behavior to control the given number of records that are loaded on each page. This way you will significantly improve the loading time of the WebDataGrid. If you set the PageSize to 20, the WebDataGrid will send to the client only 20 records of all records fetched from the database. So, if you are fetching thousands of records from the database on each request, this is still an issue. IN this situation you can use the Custom DataBinding approach. When using custom data binding, only the records that are needed to display are fetched from the data server, thus strongly decreasing the data load.
If you still need to load a high number of records on the client, the Virtual Scrolling behavior is next thing to try. Virtual Scrolling allows to send partial amounts of data records to the client, and request additional data records on demand as the end-user scrolls through the control. The Virtual Scrolling behavior therefore greatly improves performance. You can also check this sample demonstrating the Virtual Scrolling behavior.
I hope the above information is enough to get you started. Please do not hesitate to contact us if any questions occur.
Hi, I tried implementing paging. I have a couple of follow up issues though.
if I want to change the color of the Page number and make it more apparent to the user, should I override theigg_PageCurrent class? or what should be done?
Secondly, I want to make the paging index to be shown on both top and bottom of the grid.
And thirdly, when I open a record from the grid, it takes me to a new page in te same browser. Now when I hit the back button, I am back to page 1. how do I restore the page number though we hit the back button.
Thanks