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);
}
}