UseDefaultsForFasterDrawing = true causing null reference exception

I am using a custom engine with the ggc. I have a couple of summary rows above header row.
I keep getting a NullReferenceException error when I make a edit a cell in the grid that would cause the summary row to autocalc.

The error occurs in the method below at the last line (el.ParentGroup.IsExpanded).

public override bool IsChildVisible(Element el)
{
if (el is ExtraSection)
return el.ParentGroup.IsExpanded; // here you can specify when the extra section is visible.

else if (el is CaptionSection)
return true;

else
return el.ParentGroup.IsExpanded;
}

When I add a null check in this method I noticed that the summary row was not auto-calcing... so definitely something is wrong.
The culprint turns out to the the OptimizeGrid method, which I copied from one of your samples.

Apparently, when I comment out the line below..

this.gridGroupingControl1.UseDefaultsForFasterDrawing = true;

, the summary rows auto-calc fine, but when I leave it in, the app blows an exception.

Can you all please help


here's my exact OptimizeGrid method...

this.gridGroupingControl1.CounterLogic = EngineCounters.YAmount;
this.gridGroupingControl1.AllowedOptimizations = EngineOptimizations.DisableCounters | EngineOptimizations.RecordsAsDisplayElements;
this.gridGroupingControl1.UseDefaultsForFasterDrawing = true; // GDI interop drawing, FirstNRecords Summaries
this.gridGroupingControl1.InvalidateAllWhenListChanged = false; // only paint modified cells
this.gridGroupingControl1.InsertRemoveBehavior = GridListChangedInsertRemoveBehavior.InvalidateAll;
this.gridGroupingControl1.UpdateDisplayFrequency = 1; // update every number of ms (speciy 0 if Update should be called manually)
this.gridGroupingControl1.TableControl.EnableDoubleBufferSurface(); // reduce flickering

1 Reply

AD Administrator Syncfusion Team December 6, 2006 04:00 AM UTC

Hi James,

Your incident #30229 has been updated. Please refer to the incident #30229 for more details.

Thanks,
Haneef

Loader.
Up arrow icon