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

Dynamic covered ranges and refresh

The grid behaves strangely when the covered ranges are added at run time. If GridControl.Refresh is called after each modification of the CoveredRanges collection everything is fine. Otherwise the ranges sometimes remain covered after removing them from the collection and vice versa. In the attached sample a row is covered/uncovered each second. Experiment with setting and removing a Refresh call in the timer to see the effect. In my project Refresh is too expensive. I cannot use it each time I set a covered range. Is there another way? Regards, Georgi CoveredCellsAndRefresh_8112.zip

4 Replies

AD Administrator Syncfusion Team September 21, 2005 08:33 AM UTC

Hi Georgi, Can you try these alternatives this.gridControl1.InvalidateRange(GridRangeInfo.Rows(6,8)); this.gridControl1.Invalidate(); this.gridControl1.RefreshRange(GridRangeInfo.Rows(6,8)); Best regards, Stanley CoveredCellsAndRefresh.zip


GK Georgi Kashev September 21, 2005 10:45 AM UTC

It doesn''t work for me. What I''m trying to avoid is great number of QueryCellInfo. In this case all the cells are queried. I need only the newly covered cells to be redrawn. I have tried with DrawClippedGrid, but failed.


AD Administrator Syncfusion Team September 21, 2005 02:59 PM UTC

Hi Georgi, Can you try this way and see if there is improvement in the performance. this.gridControl1.BeginUpdate(); // // Code to Cover and Uncover // this.gridControl1.Invalidate(); this.gridControl1.EndUpdate(); Best regards, Stanley


AD Administrator Syncfusion Team September 22, 2005 01:44 AM UTC

Hi Georgi, this is a defect in our code. The last covered range is cached and the SetCoveredRange call did forget to reset that cache. You can work around it as follows: In your ctor call. this.gridControl1.CoveredRanges.Add(GridRangeInfo.Cell(0, 0)); The in your timer call: private void timer1_Tick(object sender, System.EventArgs e) { if (f) gridControl1.CoveredRanges.SetCoveredRange(GridRangeInfo.Row(7), true); else gridControl1.CoveredRanges.SetCoveredRange(GridRangeInfo.Row(7), false); System.Diagnostics.Debug.WriteLine("Cover/Uncover"); if (!f) { // work around: access some other covered range to clear out cached last covered range. GridRangeInfo r1 = gridControl1.CoveredRanges.FindRange(0, 0); } gridControl1.RefreshRange(GridRangeInfo.Cells(7, 0, 7, gridControl1.ColCount)); f = !f; } We will get this also corrected in our code so that the cached range gets reset. Stefan >Hi Georgi, > >Can you try this way and see if there is improvement in the performance. > > this.gridControl1.BeginUpdate(); > // > // Code to Cover and Uncover > // > this.gridControl1.Invalidate(); > this.gridControl1.EndUpdate(); > >Best regards, >Stanley

Loader.
Live Chat Icon For mobile
Up arrow icon