GridControl multi-edit

Hi,

surely this is a stupid question but I've been looking for hours now and can't find how to do this:

I want to enable multi-cell editing in the GridControl so that if the user selects a range of cells then types into one then the values of all cells selected will be set.

Thanks
felix


1 Reply

AD Administrator Syncfusion Team March 10, 2008 07:12 PM UTC

Hi felix,

Thank you for using Syncfusion products.

One way you can do this by handling the CurrentCellChanged event of the GridControl and set the new value of the currentcell into selected cells. Below are the codes:

foreach (GridRangeInfo range in this.gridControl1.Selections.Ranges)
{
int k = range.Top;
int l = range.Bottom;
int m = range.Left;
int n = range.Right;

GridCurrentCell cc=this.gridControl1.CurrentCell;
for (int i = k; i <=l; i++)
{
for (int j = m; j <=n; j++)
{
this.gridControl1.Model[i, j].Text = cc.Renderer.ControlText;
}
}
}

Please refer to the below sample for implementation and let me know if this helps
http://websamples.syncfusion.com/samples/grid.windows/f72179/main.htm

Best regards,
Johnson




Loader.
Up arrow icon