Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
24831 | Feb 11,2005 12:19 PM UTC | Feb 13,2005 04:24 PM UTC | WinForms | 8 |
![]() |
Tags: GridControl |
protected override void OnCurrentCellControlDoubleClick(ControlEventArgs e)
{
trace = true;
int o = 0;
for (int n = 2; n < 10; n++)
{
for (int c = 4; c < 8; c++)
{
if (o % 2 == 0)
{
BeginUpdate(BeginUpdateOptions.InvalidateAndScroll);
Model[n, c].CellValue = o;
EndUpdate(true);
}
o++;
}
}
trace = false;
base.OnCurrentCellControlDoubleClick (e);
}
bool trace = false;
protected override void OnCellDrawn(GridDrawCellEventArgs e)
{
if (trace)
Console.WriteLine("OnCellDrawn: {0} / {1}", e.RowIndex, e.ColIndex);
base.OnCellDrawn (e);
}
You can kick off the test by double-clicking in a cell.
If you want to go the InvalidateRange route you could use the following code:
GridStyleInfo style = new GridStyleInfo();
style.CellValue = o;
Model.SetCellInfo(n, c, style, StyleModifyType.Override, true, true);
InvalidateRange(GridRangeInfo.Cell (n, c));
Update();
If you keep having problems that might be specific to your app then. Best is then to upload a sample project that demonstrates the problem.
Stefan
>Hi
>
>I do:
>grid.Model[row, col].CellValue = c._value
>grid.InvalidateRange(GridRangeInfo.Cell (row,col));
>
>But it does not refresh graphically this single cell.
>If i call grid.beginupdate /End update without parameter, no graphical update
>if i use the Syncfusion.Windows.Forms.BeginUpdateOptions.Invalidate option it invalidates all the screen causing a huge CPU usage.
>As my refresh occur often this is a problem
>Any idea
>thanks
>B. Cliford private void btnInitGrid_Click(object sender, System.EventArgs e) { this.useDataTableList = this.checkBoxUseDataViewSort.Checked; this.calculateMaxColumnWidth = this.checkBoxCalculateMaximumWidth.Checked; this.recordCount = Convert.ToInt32(this.textBoxRecordCount.Text); this.zipCount = Convert.ToInt32(this.textBoxZipCount.Text); this.useOptimizedListChangedEvent = checkBoxUseOptimizedListChangedEvent.Checked; this.InitializeGrid(); this.grid.DrawCell += new GridDrawCellEventHandler(grid_DrawCell); t = new Timer(); t.Tick += new EventHandler(t_Tick); t.Interval = 500; t.Start(); } Timer t; Random r = new Random(); private void t_Tick(object sender, EventArgs e) { this.grid[2,2].CellValue = r.Next(100); this.grid.RefreshRange(GridRangeInfo.Cell(2,2)); } int a = 0; private void grid_DrawCell(object sender, GridDrawCellEventArgs e) { Console.WriteLine(string.Format("{0}-({1},{2}", a++, e.RowIndex, e.ColIndex)); }
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.
This page will automatically be redirected to the sign-in page in 10 seconds.