SH
Stefan Hoenig
Syncfusion Team
July 18, 2002 08:52 PM UTC
Hi Roy,
the Boolean flag indicates if only text content shall be cleared out or if all cell content information including color, cell type and other appearance information should be cleared. ClearCells does not shift cells. I agree that is something we should add (something like a MoveCells method) and we'll look into that.
What you can do now is use a combination of GetCells, SetCells and Clear to shift cells:
private void button1_Click(object sender, System.EventArgs e)
{
int top = 3;
int bottom = 10;
int colCount = this.gridControl1.ColCount;
GridRangeInfo source = GridRangeInfo.Cells(top,4,bottom,colCount);
GridRangeInfo target = GridRangeInfo.Cells(top,2,bottom,2+source.Width-1);
GridRangeInfo clear = GridRangeInfo.Cells(top,target.Right+1,bottom,colCount);
GridStyleInfoStoreTable cells = this.gridControl1.GetCells(source);
this.gridControl1.BeginUpdate();
this.gridControl1.SetCells(target, cells);
this.gridControl1.ClearCells(clear, true);
this.gridControl1.EndUpdate(false);
this.gridControl1.Refresh();
}
}
I attached a sample project.
Stefan Hoenig