NullReferenceException with RecordFilters - ggc.Refresh without repaint

I am working with a gridGroupingControl where I add and remove some recordFilters to different nested tables. Thereby sometimes I earn an unpredictable NullReferenceException (see stacktrace below) when I try to add a recordFilter to a tableDescriptor where I previous cleared all existing recordFilters. To solve the problem I have to call a ggc.Refresh between clearing all recordFilters and add the new filters. In that case the exception does not appear. My problem is now that I have the layout of ggc suspended when I remove and add the filters to avoid flicker of the layout. But calling ggc.Refresh does not take care about the suspended layout and does an repaint that leads to flicker ;-( My question: Is there a method similar to ggc.Refresh without repaint? Or is there a chance to avoid the exception without refresh? Some help would be nice. Regards, Klaus System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. at Syncfusion.Grouping.RecordFilterDescriptor.GetCompiledExpression() at Syncfusion.Grouping.RecordFilterDescriptor.set_Expression(String value) at Syncfusion.Grouping.RecordFilterDescriptor.InitializeFrom(RecordFilterDescriptor other) at Syncfusion.Grouping.RecordFilterDescriptorCollection.InitializeFrom(RecordFilterDescriptorCollection other) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableDescriptor.InitializeFrom(TableDescriptor tableDescriptor) at Syncfusion.Grouping.RelationDescriptor.InitializeFrom(RelationDescriptor other) at Syncfusion.Grouping.RelationDescriptorCollection.InitializeFrom(RelationDescriptorCollection other) at Syncfusion.Grouping.Table.SynchronizeRelatedTables() at Syncfusion.Grouping.TableCollection.SynchronizeWithRelationDescriptor() at Syncfusion.Grouping.TableCollection.get_Count() at Syncfusion.Grouping.Record.AdjustRecordRowCount() at Syncfusion.Grouping.Record.GetVisibleCount() at Syncfusion.Grouping.Record.GetCounter() at Syncfusion.Collections.BinaryTree.TreeTableWithCounterEntry.GetCounterTotal() at Syncfusion.Collections.BinaryTree.TreeTableWithCounter.GetCounterTotal() at Syncfusion.Grouping.Internals.ElementTreeTable.get_VisibleCount() at Syncfusion.Grouping.DetailsSection.GetVisibleCount() at Syncfusion.Windows.Forms.Grid.Grouping.GridGroupExtend.OnInitializeVisibleCounters(Group owner, GridGroupOptionsStyleInfo go) at Syncfusion.Windows.Forms.Grid.Grouping.GridChildTable.OnInitializeVisibleCounters() at Syncfusion.Grouping.Group.InitVisibleCounters() at Syncfusion.Grouping.Group.GetVisibleCount() at Syncfusion.Grouping.NestedTable.GetVisibleCount() at Syncfusion.Grouping.Table.OnEnsureInitialized(Object sender) at Syncfusion.Grouping.Element.EnsureInitialized(Object sender, Boolean notifyParent) at Syncfusion.Grouping.Table.EnsureInitialized(Object sender, Boolean notifyParent) at Syncfusion.Grouping.Element.EnsureInitialized(Object sender) 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.GridTableControl.GetHorizontalScrollWidth() at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.SynchronizeGridWithEngine() Eine nicht behandelte Ausnahme des Typs ''System.NullReferenceException'' ist in syncfusion.grouping.base.dll aufgetreten. Zusätzliche Informationen: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. catched at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.SynchronizeGridWithEngine() in :line 0

1 Reply

ST stanleyj Syncfusion Team January 25, 2006 02:02 PM UTC

Hi Klaus, Can you help us see this issue in any of our samples that are shipped? If you wish to Reset filters then try. this.groupingGrid1.Engine.TableDescriptor.ResetRecordFilters(); Please refer the sample in \Syncfusion\Essential Studio\4.1.0.50\windows\Grid.Grouping.Windows\Samples\GroupCustomers Best regards, Stanley

Loader.
Up arrow icon