Dear Telerik,
We have a grid created in code (Q1 2009). When a user drags a column to the group header, it works great. When the column is dragged away from the header it UnGroups correctly.
Recently we started optimizing the application. One thing we did is to set the EnableViewState=false on the Page containing the grid to make the page lighter
Everything worked great until we discovered a crash when the column is dragged away from the header. It gives the following dump:
Exception.Message
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Stack Trace
System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index)
Telerik.Web.UI.GridGroupByExpressionCollection.get_Item(Int32 index)
Telerik.Web.UI.GridGroupPanel.Ungroup(String index)
Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
After various attempts to solve the problem with no luck, we put back the EnableViewState=true on the Page containing the grid:
And the crash disappeared.
Note some other grid setting:
Can you please help?
Salah A. Malaeb
We have a grid created in code (Q1 2009). When a user drags a column to the group header, it works great. When the column is dragged away from the header it UnGroups correctly.
Recently we started optimizing the application. One thing we did is to set the EnableViewState=false on the Page containing the grid to make the page lighter
<%@Page UICulture="auto" Language="C#" AutoEventWireup="true" EnableViewState="false" CodeFile="T.aspx.cs" Inherits="_T" %> |
Everything worked great until we discovered a crash when the column is dragged away from the header. It gives the following dump:
Exception.Message
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Stack Trace
System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index)
Telerik.Web.UI.GridGroupByExpressionCollection.get_Item(Int32 index)
Telerik.Web.UI.GridGroupPanel.Ungroup(String index)
Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
After various attempts to solve the problem with no luck, we put back the EnableViewState=true on the Page containing the grid:
<%@Page UICulture="auto" Language="C#" AutoEventWireup="true" EnableViewState="true" CodeFile="T.aspx.cs" Inherits="_T" %> |
Note some other grid setting:
radGrid.GridLines = GridLines.None; |
radGrid.EnableViewState = |
radGrid.AllowMultiRowSelection = |
radGrid.ClientSettings.Selecting.AllowRowSelect = |
radGrid.ClientSettings.Selecting.EnableDragToSelectRows = true; |
radGrid.AllowAutomaticDeletes = |
radGrid.AllowAutomaticInserts = |
radGrid.AllowAutomaticUpdates = |
radGrid.FilterMenu.Visible = |
radGrid.ClientSettings.AllowKeyboardNavigation = |
radGrid.MasterTableView.EnableColumnsViewState = |
radGrid.AutoGenerateColumns = false; |
radGrid.ClientSettings.ClientEvents.OnGridCreated = "GridCreated"; |
radGrid.ClientSettings.ClientEvents.OnKeyPress = "GridKeyPressed"; |
radGrid.ClientSettings.ClientEvents.OnRowSelected = "GridRowSelected"; |
radGrid.ClientSettings.ClientEvents.OnActiveRowChanged = "GridRowChanged"; |
radGrid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None; |
radGrid.MasterTableView.ClientDataKeyNames = new string[] { "uid" }; |
radGrid.ClientSettings.AllowColumnsReorder = |
radGrid.ClientSettings.Resizing.AllowColumnResize = |
radGrid.ClientSettings.Resizing.EnableRealTimeResize = |
radGrid.ClientSettings.Resizing.ClipCellContentOnResize = radGrid.Columns.Count > 2; |
radGrid.ClientSettings.AllowKeyboardNavigation = |
radGrid.ClientSettings.Resizing.ResizeGridOnColumnResize = true; |
radGrid.ClientSettings.ClientEvents.OnRowDblClick = "GridRowDoubleClicked"; |
radGrid.MasterTableView.SortExpressions.AllowNaturalSort = false; |
radGrid.ShowGroupPanel = |
radGrid.ClientSettings.AllowDragToGroup = |
radGrid.ClientSettings.Scrolling.AllowScroll = |
radGrid.AllowFilteringByColumn = |
radGrid.ClientSettings.AllowGroupExpandCollapse = true; |
radGrid.GroupingSettings.CaseSensitive = false; |
radGrid.AllowPaging = true; |
radGrid.PagerStyle.Mode = GridPagerMode.Slider; |
radGrid.ClientSettings.Scrolling.SaveScrollPosition = |
radGrid.ClientSettings.Scrolling.UseStaticHeaders = |
radGrid.ClientSettings.Scrolling.AllowScroll = true; |
radGrid.PreRender += new EventHandler(GridPreRender); |
Can you please help?
Salah A. Malaeb