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,
Paging can be turned off and on programmatically via server side code, so you can do this based on the rows count. An example on how to enable Paging programmatically can be found at the Paging help topic.
Please let me know if you have other questions, I will be glad to help.
Hi Any Update for me in this regard?
can we make that, Paging and pager is available only when there is more than 1 page?
The easiest way to preserve the paging is keep the page index in a session before navigating to other pager, and restore that page on each postback:
protected void btAction_Click(object sender, EventArgs e) { Session["CurrentGridPage"] = WebDataGrid1.Behaviors.Paging.PageIndex; Response.Redirect("newage.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["CurrentGridPage"] != null) { int page = (int)(Session["CurrentGridPage"]); WebDataGrid1.Behaviors.Paging.PageIndex = page; } }... }
Please let me know if you have other questions, I will be glad to help
Hi, So for the third question, if a user is viewing records on page 3 and clicks on something that takes to a different page. After the user hits the browser back button, the Pageindex is reset to 1. But the user want to have it as 3 (from what page index was he navigated). Is itr possible, or am I missing something.