Home Forums WinForms controls Xceed Grid for WinForms Row containing Controls on FooterRows Reply To: Row containing Controls on FooterRows

User (Old forums)
Member
Post count: 23064

I was finally able to solve this problem, by inherting from the Row class and overriding the PaintForeGround method. It looks exactly like the way i wanted it.
Here is the code if anyone else came across similar problem,

protected override void PaintForeground(GridPaintEventArgs e)
{
SizeF stringSize;
using (Brush brush = new SolidBrush(this.GetDisplayForeColor()))
{
Rectangle layoutRectangle = e.DisplayRectangle;
layoutRectangle.X++;
layoutRectangle.Height -= 2;
layoutRectangle.Y+=3;
e.Graphics.DrawString(“The lable:”, base.Font, brush, layoutRectangle, GetDisplayStringFormat());
stringSize = e.Graphics.MeasureString(“The lable:”, base.Font);
}

Rectangle clientRectangle = ClientRectangleToGrid(e.DisplayRectangle);
_control.Location= new Point(clientRectangle.X + 2 + (int)stringSize.Width, clientRectangle.Y + 1);
_control.Parent = _parentGridControl;
_control.BringToFront();
_control.Visible = true;

}

Imported from legacy forums. Posted by userX (had 2982 views)