AD
Administrator
Syncfusion Team
May 22, 2005 06:54 PM UTC
Jason,
your call stack does not include line numbers but looking at the source code it looks like the grid throws the exception at the line below:
internal bool DeactivateCurrentCell(bool allowCancel)
{
if (CurrentCell.HasCurrentCell)
{
... if (Table.DisplayElements[CurrentCell.RowIndex] is NestedTable)
{
Possibly CurrentCell.RowIndex is out of sync and greater than Table.DisplayElements.Count.
I can make a change in that method and add check for that so that now exception gets thrown in future. But there might be other places too.
I recommend that in your PositionGridBuilder.Build method that you Unlock the current cell and call grid.TableControl.CurrentCell.Deactivate() before you call GridSummaryRowDescriptorCollection.Clear(). That should avoid the problem.
Or is that where you do need the Lock? Then changing the DeactivateCurrentCell code is the only way out.
Stefan
>I wonder if you can help me with an exception that gets thrown every so often. We''re using v3.2.1.0 of grouping grid
>
>If I totally recreate the grid I get an exception "Specified argument was out of the range of valid values".
>
>It looks as though it''s related to DeactivateCurrentCell. I''ve noticed some debug messages appearing since version 3 regarding deactivating the current cell and using Grid.CurrentCell.Lock().
>
>My control is totally recalculated every so often, ie clear datatable and recreate visible cols, grouping etc
>
>Thanks in advance
>
>Jason
>StackTrace :
> at Syncfusion.Grouping.RuntimeElementsInTableCollection.get_Item(Int32 index)
> at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.DeactivateCurrentCell(Boolean allowCancel)
> at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.table_DisplayElementChanging(Object sender, DisplayElementChangingEventArgs e)
> at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.OnDisplayElementChanging(DisplayElementChangingEventArgs e)
> at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.Syncfusion.Grouping.ITableEventsTarget.OnDisplayElementChanging(DisplayElementChangingEventArgs e)
> at Syncfusion.Grouping.TableDescriptor.Syncfusion.Grouping.ITableEventsTarget.OnDisplayElementChanging(DisplayElementChangingEventArgs e)
> at Syncfusion.Grouping.Table.OnDisplayElementChanging(DisplayElementChangingEventArgs e)
> at Syncfusion.Grouping.Table.RaiseDisplayElementChanging(Element element, Int32 oldCount, Int32 newCount, Boolean repaintElement, Boolean syncCurrentRecordPos, Boolean leaveCurrentRecord, Boolean scroll)
> at Syncfusion.Grouping.Table.Engine_PropertyChanging(Object sender, DescriptorPropertyChangedEventArgs e)
> at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.Engine_PropertyChanging(Object sender, DescriptorPropertyChangedEventArgs e)
> at Syncfusion.Grouping.DescriptorPropertyChangedEventHandler.Invoke(Object sender, DescriptorPropertyChangedEventArgs e)
> at Syncfusion.Grouping.Engine.OnPropertyChanging(DescriptorPropertyChangedEventArgs e)
> at Syncfusion.Windows.Forms.Grid.Grouping.GridEngine.TableDescriptor_PropertyChanging(Object sender, DescriptorPropertyChangedEventArgs e)
> at Syncfusion.Grouping.DescriptorPropertyChangedEventHandler.Invoke(Object sender, DescriptorPropertyChangedEventArgs e)
> at Syncfusion.Grouping.TableDescriptor.OnPropertyChanging(DescriptorPropertyChangedEventArgs e)
> at Syncfusion.Windows.Forms.Grid.Grouping.GridTableDescriptor.summaryRows_Changing(Object sender, ListPropertyChangedEventArgs e)
> at Syncfusion.Windows.Forms.Grid.Grouping.GridSummaryRowDescriptorCollection.OnChanging(ListPropertyChangedEventArgs e)
> at Syncfusion.Windows.Forms.Grid.Grouping.GridSummaryRowDescriptorCollection.Clear()
> at Simulator.ReportBuilders.PositionReport.PositionGridBuilder.Build(DataTable dataTable, ArrayList portfolioList, ArrayList assetList, ColumnValueCollection selectedAssetColumns, ColumnValuePosition sortCol, CategoryTypeDictionary groupByCategoryTypes, Double minEditValue, Double maxEditValue, Boolean isUsing100PCTotalling) in C:\data\prism\Simulator\ReportBuilders\PositionReport\PositionGridBuilder.cs:line 95
> at Simulator.ReportBuilders.PositionReport.PositionReportRecalc.InvokeGridBuilderThe thread ''Logger'' (0x664) has exited with code 0 (0x0).
>() in C:\data\prism\Simulator\ReportBuilders\PositionReport\PositionReportRecalc.cs:line 199
> at Simulator.ReportBuilders.PositionReport.PositionReportRecalc.Execute(SimulatorData newSimData, PositionReportSettings newSettings, Boolean hasSelectedAsset, Int32 selectedAssetID) in C:\data\prism\Simulator\ReportBuilders\PositionReport\PositionReportRecalc.cs:line 103
> at SimUI.PositionGridControl.HandlerForRecalcPositionGrid() in C:\data\prism\Simulator\PositionGridControl.cs:line 1020
> at Simulator.Controllers.RecalcPositionsHandler.Invoke()
> at Simulator.Controllers.SimulatorController.FireRecalcPositions() in C:\data\prism\Simulator\Controllers\SimulatorController.cs:line 2704
> at SimUI.PositionGridControl.cmbGroupBy_SelectionChangeCommitted(Object sender, EventArgs e) in C:\data\prism\Simulator\PositionGridControl.cs:line 1331
> at System.Windows.Forms.ComboBox.OnSelectionChangeCommitted(EventArgs e)
> at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
> at System.Windows.Forms.ComboBox.WndProc(Message& m)
> at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
> at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
> at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
>
>