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


I am looking for some documentation on the BeginUpdateOptions. Specifically, BeginUpdateOptions.Invalidate. I have the following code, which I am trying to optimize when I want to refresh the "viewable" portion of a grid. Thanks, STeve this.BeginUpdate(Syncfusion.Windows.Forms.BeginUpdateOptions.Invalidate); this.RefreshRange(this.ViewLayout.VisibleCellsRange,GridRangeOptions.None,true); this.EndUpdate(true);

1 Reply

AD Administrator Syncfusion Team April 12, 2004 03:14 PM

Normally you do not call RefreshRange within a Begin/End Update block. The idea of this block is to turn off the painting in this block. If you use this code, this.gridControl1.BeginUpdate(); this.gridControl1[2,1].Text = "aaaaa"; this.gridControl1[3,1].Text = "aaaaa"; this.gridControl1[4,1].Text = "aaaaa"; this.gridControl1[5,1].Text = "aaaaa"; this.gridControl1.EndUpdate(); then you will not see any changes until those cells are forced to repaint (maybe by dragging the form off/on the display, or by explicitly calling gridControl1.Refresh or RefreshRange. But if you use this code, this.gridControl1.BeginUpdate(Syncfusion.Windows.Forms.BeginUpdateOptions.Invalidate); this.gridControl1[2,1].Text = "aaaaa"; this.gridControl1[3,1].Text = "aaaaa"; this.gridControl1[4,1].Text = "aaaaa"; this.gridControl1[5,1].Text = "aaaaa"; this.gridControl1.EndUpdate(true); the cells get redrawn when the EndUpdate is called. The Invalidate option means that regions are marked invalid instead of being redrawn. Then on the EndUpdate call, a call to Control.Update is made that forces the paint to take place.

Live Chat Icon For mobile
Up arrow icon