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.
Unfortunately, activation email could not send to your email. Please try again.

Dynamic covered ranges and refresh

Thread ID:

Created:

Updated:

Platform:

Replies:

34955 Sep 20,2005 08:15 AM Sep 21,2005 09:44 PM Windows Forms 4
loading
Tags: GridControl
Georgi Kashev
Asked On September 20, 2005 08:15 AM

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

Administrator [Syncfusion]
Replied On September 21, 2005 04:33 AM

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

Georgi Kashev
Replied On September 21, 2005 06:45 AM

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.

Administrator [Syncfusion]
Replied On September 21, 2005 10:59 AM

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

Administrator [Syncfusion]
Replied On September 21, 2005 09:44 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;