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.

Drawing of GridLines

Thread ID:

Created:

Updated:

Platform:

Replies:

21950 Nov 29,2004 06:27 PM Nov 30,2004 03:00 AM Windows Forms 1
loading
Tags: GridControl
Steve
Asked On November 29, 2004 06:27 PM

In the onPaint event (or possibly override), I want to re-draw the gridlines for a specific cell. (top,bottom,left & right). What method should I call to redraw these lines? Thanks, Steve

Administrator [Syncfusion]
Replied On November 30, 2004 03:00 AM

You can try this static method. GridBorderPaint.DrawRectangle Here is code that the grid uses to draw borders.
public void OnDrawBorders(Graphics g, Rectangle rectItem, GridStyleInfo style)
{
	// Draw Borders
	Color backColor = m_grid.GetBackColor(style.Interior.BackColor);
	GridBordersInfo borders = style.ReadOnlyBorders;
	TraceUtil.TraceCurrentMethodInfoIf(Switches.GridBorderPaint.TraceVerbose, m_grid.PaneDesc, rectItem, borders);
	GridBorderPaint.DrawRectangle(g, borders.Top, rectItem, backColor, GridBorderSide.Top, m_grid.PrintingMode);
	GridBorderPaint.DrawRectangle(g, borders.Bottom, rectItem, backColor, GridBorderSide.Bottom, m_grid.PrintingMode);
	if (this.isRightToLeft())
	{
		GridBorderPaint.DrawRectangle(g, borders.Right, rectItem, backColor, GridBorderSide.Left, m_grid.PrintingMode);
		GridBorderPaint.DrawRectangle(g, borders.Left, rectItem, backColor, GridBorderSide.Right, m_grid.PrintingMode);
	}
	else
	{
		GridBorderPaint.DrawRectangle(g, borders.Left, rectItem, backColor, GridBorderSide.Left, m_grid.PrintingMode);
		GridBorderPaint.DrawRectangle(g, borders.Right, rectItem, backColor, GridBorderSide.Right, m_grid.PrintingMode);
	}
}

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.

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.

;