Hi Markus,
Change color on Editing This can be achieved by handling TableControlPrepareViewStyleInfo and TableControlCellClick events.
Please see the code:
this.gridGroupingControl1.TableControlPrepareViewStyleInfo += new GridTableControlPrepareViewStyleInfoEventHandler(gridGroupingControl1_TableControlPrepareViewStyleInfo);
this.gridGroupingControl1.TableControlCellClick +=new GridTableControlCellClickEventHandler(gridGroupingControl1_TableControlCellClick);
//
ArrayList doubleClickedCells = new ArrayList();
private int GetLookUpCode(int row, int col)
{ return 10000 * col + row; }
void gridGroupingControl1_TableControlPrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e)
{
if (doubleClickedCells.IndexOf(GetLookUpCode(e.Inner.RowIndex, e.Inner.ColIndex)) > -1)
{
e.Inner.Style.BackColor = Color.Blue;
}
}
void gridGroupingControl1_TableControlCellClick(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventArgs e)
{
int row, col;
Point pt = this.gridGroupingControl1.PointToClient(Cursor.Position);
if (this.gridGroupingControl1.TableControl.PointToRowCol(pt, out row, out col))
{
int code = GetLookUpCode(row, col);
if (doubleClickedCells.IndexOf(code) == -1)
doubleClickedCells.Add(code);
else
doubleClickedCells.Remove(code);
this.gridGroupingControl1.TableControl.RefreshRange(GridRangeInfo.Cell(row, col), true);
}
}
Prevent dynamic sorting You need to implement a ListWrapper class to preserve the sorted rows and avoid the grid from further sorting. Having done this, you can wrap the datasource of the grid to a ListWrapper object and wire the grid to it. Please refer the below sample for more details.
http://websamples.syncfusion.com/samples/Grid.Windows/Grid_WF_GGCPreventDynamicSort/main.htmChange HeaderText This can be achieved by setting the HeaderText property.
this.gridGroupingControl1.TableDescriptor.Columns[2].HeaderText = "Mytext";
Regards,
Jisha