You can draw it your self. Handle CellBeginEdit to set a flag when the
row starts editing. Test this flag in CellPainting and draw the icon
when needed. Then reset the flag in CurrentCellChanged when you move
off the row.
private int editingRowIndex = int.MinValue;
void dataGridView1_CellBeginEdit(object sender,
DataGridViewCellCancelEventArgs e)
{
editingRowIndex = e.RowIndex;
}
void dataGridView1_CurrentCellChanged(object sender, EventArgs
e)
{
if (dataGridView1.CurrentCell.RowIndex != editingRowIndex)
{
editingRowIndex = int.MinValue;
}
}
void dataGridView1_CellPainting(object sender,
DataGridViewCellPaintingEventArgs e)
{
if (e.ColumnIndex == -1 && e.RowIndex == editingRowIndex)
{ //drawing row header
e.Paint(e.ClipBounds, DataGridViewPaintParts.All);
Rectangle rect = e.CellBounds;
rect.X += 4;//move in a little
rect.Width = 16;
e.Graphics.DrawIcon(pencilIcon, rect);
e.Handled = true;
}
}
=====================
Clay Burch
Syncfusion, Inc.
imran.a - 30 Jul 2007 20:04 GMT
Thanks Clay I will try this out. Any idea where I can find the pencil icon or
will I have to add my own icon file.
Thanks,
Imran
> You can draw it your self. Handle CellBeginEdit to set a flag when the
> row starts editing. Test this flag in CellPainting and draw the icon
[quoted text clipped - 32 lines]
> Clay Burch
> Syncfusion, Inc.