We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Highlight whole grid border

Thread ID:

Created:

Updated:

Platform:

Replies:

52120 Nov 22,2006 09:32 AM UTC Nov 23,2006 06:03 AM UTC Windows Forms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 22, 2006 09:32 AM UTC

Hi,

I would like to highlight (say by a particular color) the grid border of a databoundgrid upon selection of a particular cell or cliclking on the cell.

Any property or way to acheive this?

Thanks,
Dheeraj

Administrator [Syncfusion]
Replied On November 22, 2006 10:28 AM UTC

Hi Dheeraj,

Please refer to the below forum thread for changing the selected row border in a grid.
http://www.syncfusion.com/support/forums/message.aspx?MessageID=44233

If you want to change the border color of the grid, you can use the Paint event and draw border using DrawRectangle method. Here is a code snippet to show this.

private void gridControl1_Paint(object sender, PaintEventArgs e)
{
GridControl grid = sender as GridControl;
Rectangle rect = new Rectangle(new Point(0,0),grid.Bounds.Size);
rect.Inflate(-1,-1);
Pen pen = new Pen(Brushes.RoyalBlue,2);
e.Graphics.DrawRectangle(pen,rect);
}

Best Regards,
Haneef

Dheeraj
Replied On November 22, 2006 10:44 AM UTC

Hi Haneef,

Thanks for the Paint event code, only thing is I need to paint the border only when clilking on the grid control. How do I call this event method from the Clik event?

Thanks,
Dheeraj

Administrator [Syncfusion]
Replied On November 22, 2006 11:41 AM UTC

Hi Dheeraj,

Use this code to refresh the grid.

this.gridControl1.Invalidate();

Best Regards,
Haneef

Dheeraj
Replied On November 23, 2006 06:03 AM UTC

That worked...Thank you!

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;