We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridGroupingControl issues

I am having a problem with the GridGroupingControl. I am using it in an inherited form, where the Grid was added to the base class. For some reason, when the form loads i get the following exception:

Item has already been added. Key in dictionary: "Row 1Summary 1"
Key being added: "Row 1Summary 1".

The exception is:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentException: Item has already been added. Key in dictionary: "Row 1Summary 1" Key being added: "Row 1Summary 1"
at System.Collections.SortedList.Add(Object key, Object value)
at Syncfusion.Grouping.SummaryDescriptorCollection.Find(String name)
at Syncfusion.Grouping.SummaryDescriptorCollection.IndexOf(String name)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.GetColumnMaxLength(GridColumnDescriptor column, FieldDescriptor rfield)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.GetColumnMaxLength(GridColumnDescriptor column)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.GetPreferredColumnWidth(Graphics g, GridColumnDescriptor column, Int32 maxWidth)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.GetPreferredColumnWidth(Graphics g, GridColumnDescriptor column)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.UpdateColumnWidths(Boolean force)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.UpdateColumnWidths()
at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.VisibleColumns_TotalWidthRequest(Object sender, CancelEventArgs e)
at Syncfusion.Windows.Forms.Grid.Grouping.GridVisibleColumnDescriptorCollection.OnTotalWidthRequest(CancelEventArgs e)
at Syncfusion.Windows.Forms.Grid.Grouping.GridVisibleColumnDescriptorCollection.get_TotalWidth()
at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.GetHorizontalScrollWidth(Boolean isNested)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.GetHorizontalScrollWidth()
at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.get_LastColumnWidth()
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.OnQueryColWidth(GridRowColSizeEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridModel.RaiseQueryColWidth(GridRowColSizeEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridModelColWidthsIndexer.OnQuerySize(GridRowColSizeEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridModelRowColSizeIndexer.GetSize(Int32 index)
at Syncfusion.Windows.Forms.Grid.GridModelRowColSizeIndexer.get_Item(Int32 index)
at Syncfusion.Windows.Forms.Grid.GridControlBase.GetColWidth(Int32 colIndex)
at Syncfusion.Windows.Forms.Grid.GridViewLayout.Initialize()
at Syncfusion.Windows.Forms.Grid.GridViewLayout.DemandInitialize()
at Syncfusion.Windows.Forms.Grid.GridViewLayout.get_LastVisibleRow()
at Syncfusion.Windows.Forms.Grid.GridControlBase.set_GridBounds(Rectangle value)
at Syncfusion.Windows.Forms.Grid.GridControlBase.DrawGrid(Graphics g, Rectangle bounds, Boolean drawCurrentCell, Boolean shouldClip)
at Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl.OptimizeLoadTime()
at Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl.f_Load(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.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, IntP


Since this is all in syncfusion code, i don''t know where to start.

2 Replies

AD Administrator Syncfusion Team August 2, 2006 02:25 PM UTC

It looks like this line causes the problem, but only when the grid has no entries:

gridSummaryRowDescriptor1.SummaryColumns.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridSummaryColumnDescriptor[] {
gridSummaryColumnDescriptor1});

Unfortunetly, any time I make changes using the designer, that line will be added back again. Is there any way to prevent this.


AD Administrator Syncfusion Team August 2, 2006 03:00 PM UTC

After some more investigation...

I have a SummaryRow defined in my base class. For some reason, every time i make changes in the designer, it will duplicate the SummaryRow in the inherited class. Not only does it dupplicate it, it will add the same entry every time I make a change in the designer.

I can fix it by deleting the SummaryRows in the inherited class, but I have to do this every time I make a change.

Loader.
Live Chat Icon For mobile
Up arrow icon