Friday, 14 December 2012

Displaying Row Numbers in a DataGrid Row Header



Solutions : 
using System.Drawing;
private void gridviewAll_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
             Font drawFont = new Font("Arial", 10);   
            e.Graphics.DrawString((e.RowIndex + 1).ToString(), drawFont, SystemBrushes.ControlText,    
                 e.RowBounds.Location.X + 15, e.RowBounds.Location.Y);
 }

No comments:

Post a Comment