Hello Haneef,
Thanks a lot for your help but my problem is a little different. Your example works properly but I don't want to set the first row cell. When I select a row on first cell and I want to move this selection (like drag&drop case) I want the cursor change from black arrow in another icon black circle, strikethrough).
Regards !
>Hi Venatir,
Try setting the CellType of the RowHeader cell to "Header" and handle the DrawCell event to draw the image on the cell in a Grid. Here is a code snippet to show this.
this.gridDataBoundGrid1.BaseStylesMap["Row Header"].StyleInfo.CellType = "Header";
this.gridDataBoundGrid1.DrawCell +=new GridDrawCellEventHandler(gridDataBoundGrid1_DrawCell);
private void gridDataBoundGrid1_DrawCell(object sender, GridDrawCellEventArgs e)
{
GridDataBoundGrid grid = sender as GridDataBoundGrid;
GridCurrentCell cc = grid.CurrentCell;
if( e.RowIndex == cc.RowIndex && e.ColIndex == 0 )
{
e.Renderer.Draw(e.Graphics,e.Bounds,e.RowIndex,e.ColIndex,e.Style);
e.Graphics.DrawImage(SystemIcons.Exclamation.ToBitmap(),e.Bounds);
e.Cancel = true;
}
}
Please refer to the attached sample for implementation.
GDBGRowHeaderIcon.zipBest Regards,
Haneef