Hi Ubaid,
You can handle the DrawCell event to draw the rectangel before the cell text in a grid cell. Please try the attached sample and let me know if this helps.
Sample :
DrawRectangleCell.zip//Code....
private void gridControl1_DrawCell(object sender, GridDrawCellEventArgs e)
{
if(e.RowIndex > 0 && e.ColIndex > 0)
{
if( e.Style.Text != null && e.Style.Text != string.Empty )
{
e.Style.TextMargins.Left = 5;
e.Renderer.Draw(e.Graphics,e.Bounds,e.RowIndex,e.ColIndex,e.Style);
e.Graphics.FillRectangle(Brushes.Red,new Rectangle(e.Bounds.X,e.Bounds.Y,5,17));
e.Cancel = true;
}
}
}
Best Regards,
Haneef