
| if (!IsPostBack) |
| { |
| RecordKeepingGrid.ShowGroupPanel = true; |
| RecordKeepingGrid.GroupingEnabled = true; |
| RecordKeepingGrid.AllowPaging = true; |
| RecordKeepingGrid.AllowSorting = true; |
| RecordKeepingGrid.AllowFilteringByColumn = true; |
| RecordKeepingGrid.AutoGenerateColumns = false; |
| RecordKeepingGrid.PagerStyle.Mode = GridPagerMode.NumericPages; |
| RecordKeepingGrid.PageSize = 20; |
| GridBoundColumn boundColumn2 = new GridBoundColumn(); |
| RecordKeepingGrid.MasterTableView.Columns.Add(boundColumn2); |
| boundColumn2.UniqueName = "FieldNameRK"; |
| boundColumn2.DataField = "Field.Name"; |
| boundColumn2.HeaderText = "Field Name"; |
| boundColumn2.AllowFiltering = true; |
| boundColumn2.AllowSorting = true; |
| boundColumn2.AutoPostBackOnFilter = true; |
| boundColumn2.Groupable = true; |
| boundColumn2.Reorderable = true; |
| GridBoundColumn boundColumn = new GridBoundColumn(); |
| RecordKeepingGrid.MasterTableView.Columns.Add(boundColumn); |
| boundColumn.UniqueName = "StartDateRK"; |
| boundColumn.DataField = "startDate"; |
| boundColumn.HeaderText = "Start Date"; |
| boundColumn.DataType = Type.GetType("System.DateTime"); |
| boundColumn.AllowFiltering = true; |
| boundColumn.AllowSorting = true; |
| boundColumn.AutoPostBackOnFilter = true; |
| boundColumn.Groupable = true; |
| boundColumn.Reorderable = true; |
| GridBoundColumn boundColumn3 = new GridBoundColumn(); |
| RecordKeepingGrid.MasterTableView.Columns.Add(boundColumn3); |
| boundColumn3.UniqueName = "TypeOperationRK"; |
| boundColumn3.DataField = "operation.typeOperation.name"; |
| boundColumn3.HeaderText = "Operation Type"; |
| boundColumn3.AllowFiltering = true; |
| boundColumn3.AllowSorting = true; |
| boundColumn3.AutoPostBackOnFilter = true; |
| boundColumn3.Groupable = true; |
| boundColumn3.Reorderable = true; |
| GridBoundColumn boundColumn4 = new GridBoundColumn(); |
| RecordKeepingGrid.MasterTableView.Columns.Add(boundColumn4); |
| boundColumn4.UniqueName = "OperationNameRK"; |
| boundColumn4.DataField = "operation.name"; |
| boundColumn4.HeaderText = "Operation Name"; |
| boundColumn4.AllowFiltering = true; |
| boundColumn4.AllowSorting = true; |
| boundColumn4.AutoPostBackOnFilter = true; |
| boundColumn4.Groupable = true; |
| boundColumn4.Reorderable = true; |
| GridBoundColumn boundColumn5 = new GridBoundColumn(); |
| RecordKeepingGrid.MasterTableView.Columns.Add(boundColumn5); |
| boundColumn5.UniqueName = "AreaRK"; |
| boundColumn5.DataField = "area"; |
| boundColumn5.HeaderText = "Area"; |
| boundColumn5.AllowFiltering = true; |
| boundColumn5.AllowSorting = true; |
| boundColumn5.AutoPostBackOnFilter = true; |
| boundColumn5.Groupable = true; |
| boundColumn5.Reorderable = true; |
| } |
| long[] fieldsSelected = [..........].getFields(); |
| [.............................] |
| List<OR[....]> lstRk = new List<OR[....]>(); |
| if (fieldsSelected.Length != 0) |
| { |
| foreach (long id in fieldsSelected) |
| { |
| foreach (OR[....] ork in rs.getR[....]ByIdField(id)) |
| { |
| lstRk.Add(ork); |
| } |
| } |
| MyGrid.DataSource = lstRk; |
| MyGrid.DataBind(); |
| } |
| MyGrid.DataBind(); |
| Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation. |
I have the follwing grid which contains 1500 rows. if I try to sort on a column, it takes over twenty seconds. Is there any way to speed up the sorting?
<telerik:RadGrid ID="rgAdvSearch" runat="server"
AllowSorting="True" AutoGenerateColumns="False" GridLines="None"
Skin="WebBlue" Width="100%" AllowMultiRowSelection="True">
<SelectedItemStyle BackColor="#99CCFF" />
<ClientSettings>
<Selecting AllowRowSelect="True" />
<ClientEvents OnRowDblClick="Row_Select" OnRowClick="Row_Single_Click" />
<Scrolling AllowScroll="True" />
</ClientSettings>
<MasterTableView PageSize="30" EnableViewState="true"
ClientDataKeyNames="type, start_time, end_time, nature_cct, status_ss, ref_no, intrp_no, match_lid"
Width="98%">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridCheckBoxColumn CurrentFilterFunction="NoFilter"
DataField="match_lid" FilterListOptions="VaryByDataType"
ForceExtractValue="None" HeaderText="Match LID"
UniqueName="match_lid1">
<ItemStyle Width="1px" />
<FooterStyle Width="1px" />
<HeaderStyle Height="1px" Width="70px" />
</telerik:GridCheckBoxColumn>
<telerik:GridBoundColumn DataField="type" HeaderText="Type" UniqueName="type">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="start_time" DataType="System.DateTime"
HeaderText="Start Time" UniqueName="start_time" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="end_time" DataType="System.DateTime"
HeaderText="End Time" UniqueName="end_time" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="nature_cct" HeaderText="Nature / Cct No."
UniqueName="nature_cct">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="status_ss"
HeaderText="Status / Substation / Description" UniqueName="status_ss">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ref_no" HeaderText="Ref. No."
UniqueName="ref_no" Aggregate="Count">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="intrp_no" UniqueName="intrp_no" Visible = "false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="match_lid" UniqueName="match_lid" Visible = "false">
</telerik:GridBoundColumn>
</Columns>
<PagerStyle Mode="NextPrevNumericAndAdvanced" />
<HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False"
Font-Strikeout="False" Font-Underline="False" ForeColor="Black" Wrap="True" />
</MasterTableView>
<FilterMenu EnableTheming="True" Skin="WebBlue">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
</telerik:RadGrid>