Hi,
I am adding UltraGrid grouping's through code using ...SortedColumns.Add(...) API and my requirement is to Limit the number of Grouped by rows (say to Top 10). Now when i mark all other rows in the Grid except the Top 10 rows as Hidden then i receive an exception. Is this the BUG in WinCalcManager? Can i resolve this issue somehow?
Can someone please help me on this.
Code Snippet:-
private void grid_InitializeGroupByRow(object sender, InitializeGroupByRowEventArgs
e)
{
int i = 0;
if(e.Row.IsGroupByRow)
e.Row.ExpandAll();
MyApp.GUIDecorator.UI.Controls.
SortDefinition ?sortedColumn = GetSortedData(e.Row.Column.Header.Column.Key);
if (sortedColumn != null)
if(e.Row.Index >= sortedColumn.GetValueOrDefault().topncount)
e.Row.Hidden =
true;
}
Exception:-
" at Infragistics.Win.UltraWinGrid.RefRowIterator.MoveNext()\r\n at Infragistics.Win.UltraWinGrid.RefSummaryValueCollection.RefSummaryValueCollectionEnumerator.MoveNext()\r\n at Infragistics.Win.CalcEngine.RangeCalcInfo.EvaluateNextRow()\r\n at Infragistics.Win.CalcEngine.UltraCalcEngine.Evaluate(Int64 ticks)\r\n at Infragistics.Win.CalcEngine.UltraCalcEngine.Recalc(Int64 ticks)\r\n at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalcInternal(Int64 ticks)\r\n at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalc(Int64 millis)\r\n at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalc()\r\n at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalcSynchronous()\r\n at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.VerifyReCalc()\r\n at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.DirtyCalc(IUltraCalcReference reference, ValueDirtiedAction action)\r\n at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.Infragistics.Win.CalcEngine.IUltraCalcManager.RemoveRowReference(IUltraCalcReference reference)\r\n at Infragistics.Win.UltraWinGrid.RowsCollection.NotifyCalcManager_RowDeleted(UltraGridRow row)\r\n at Infragistics.Win.UltraWinGrid.RowsCollection.NotifyCalcManager_HiddenStateChanged(UltraGridRow row)\r\n at Infragistics.Win.UltraWinGrid.UltraGridRow.HiddenStateChanged(Boolean dirtySummaries)\r\n at Infragistics.Win.UltraWinGrid.UltraGridRow.HiddenStateChanged()\r\n at Infragistics.Win.UltraWinGrid.UltraGridRow.set_Hidden(Boolean value)\r\n at Myapp.GUIDecorator.UI.View.Table.UltraGridTableRenderer.grid_InitializeGroupByRow(Object sender, InitializeGroupByRowEventArgs e)\r\n at Infragistics.Win.UltraWinGrid.UltraGrid.OnInitializeGroupByRow(InitializeGroupByRowEventArgs e)\r\n at Infragistics.Win.UltraWinGrid.UltraGrid.FireEvent(GridEventIds id, EventArgs e)\r\n at Infragistics.Win.UltraWinGrid.UltraGrid.FireInitializeGroupRow(InitializeGroupByRowEventArgs e)\r\n at Infragistics.Win.UltraWinGrid.UltraGridGroupByRow.FireInitializeRow()\r\n at Infragistics.Win.UltraWinGrid.RowsCollection.CreateGroupByRowsHelper(UltraGridRow[] rows, Int32& startIndex, Boolean rowsAlreadySorted)\r\n at Infragistics.Win.UltraWinGrid.RowsCollection.InitGroupByRows()\r\n at Infragistics.Win.UltraWinGrid.RowsCollection.VerifyGroupByVersion()\r\n at Infragistics.Win.UltraWinGrid.RowsCollection.VerifyGroupByVersionHelper()\r\n at Infragistics.Win.UltraWinGrid.UltraGridRow.get_ParentRow()\r\n at Infragistics.Win.UltraWinGrid.UltraGridRow.get_HiddenResolved()\r\n at Infragistics.Win.UltraWinGrid.RowScrollRegion.get_FirstRow()\r\n at Infragistics.Win.UltraWinGrid.RowScrollRegion.GetMaxScrollPosition(Boolean scrollToFill)\r\n at Infragistics.Win.UltraWinGrid.RowScrollRegion.EnsureScrollRegionFilled(Boolean calledFromRegenerateVisibleRows)\r\n at Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows(Boolean resetScrollInfo)\r\n at Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows()\r\n at Infragistics.Win.UltraWinGrid.RowScrollRegion.WillScrollbarBeShown(ScrollbarVisibility assumeColScrollbarsVisible)\r\n at Infragistics.Win.UltraWinGrid.ScrollRegionBase.WillScrollbarBeShown()\r\n at Infragistics.Win.UltraWinGrid.RowScrollRegion.PositionScrollbar(Boolean resetScrollInfo)\r\n at Infragistics.Win.UltraWinGrid.ScrollRegionBase.SetOriginAndExtent(Int32 origin, Int32 extent)\r\n at Infragistics.Win.UltraWinGrid.RowScrollRegion.SetOriginAndExtent(Int32 origin, Int32 extent)\r\n at Infragistics.Win.UltraWinGrid.DataAreaUIElement.ResizeRowScrollRegions()\r\n at Infragistics.Win.UltraWinGrid.DataAreaUIElement.PositionChildElements()\r\n at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)\r\n at Infragistics.Win.UltraWinGrid.DataAreaUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)\r\n at Infragistics.Win.UltraWinGrid.DataAreaUIElement.set_Rect(Rectangle value)\r\n at Infragistics.Win.UltraWinGrid.UltraGridUIElement.PositionChildElements()\r\n at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)\r\n at Infragistics.Win.UltraWinGrid.UltraGridUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)\r\n at Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics)\r\n at Infragistics.Win.UIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics)\r\n at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize, Boolean preventAlphaBlendGraphics)\r\n at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize)\r\n at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode)\r\n at Infragistics.Win.UltraWinGrid.UltraGridUIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode)\r\n at Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe)\r\n at Infragistics.Win.UltraWinGrid.UltraGrid.OnPaint(PaintEventArgs pe)\r\n at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)\r\n at System.Windows.Forms.Control.WmPaint(Message& m)\r\n at System.Windows.Forms.Control.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)"
It's impossible to say if this is a bug with just a code snippet and a call stack.
Can you duplicate this exception in a small sample project so we can check it out?
What version of the grid are you using?
Mike,
I have reproduced the problem in the attached sample project. Here the problem occurs only once i attach a summary to the grid. If i clear the summaries during
InitializeGroupByRow then it works but then i need summaries on the columns which are not hidden.
Thanks,
Sandeep