How can I apply borders to cells?

Here is an example:

   SetStyleRange(range, CGXStyle( )
      .SetBorders(gxBorderTop, CGXPen()
      .SetWidth(2)
      .SetStyle(PS_SOLID)
      .SetColor(RGB(255,0,0))
      );