Row border - visibility and colors

2 posts, 0 answers
  1. Mark
    Mark avatar
    3 posts
    Member since:
    Nov 2012

    Posted 09 Mar 2015 Link to this post

    I want to display the bottom border of by rows in white so that I get a nice single line between rows.

    I have played with code like:

    Private Sub RadGridView1_RowFormatting(sender As Object, e As Telerik.WinControls.UI.RowFormattingEventArgs) Handles RadGridView1.RowFormatting

    e.RowElement.DrawBorder = True
    e.RowElement.BorderColor = Color.White
    e.RowElement.BorderTopWidth = 0
    e.RowElement.BorderBottomWidth = 2
    e.RowElement.BorderLeftWidth = 0
    e.RowElement.BorderRightWidth = 0


    Private Sub RadGridView1_CellFormatting(sender As Object, e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles RadGridView1.CellFormatting
    e.CellElement.DrawBorder = True
    e.CellElement.BorderColor = Color.White
    e.CellElement.BorderTopWidth = 0
    e.CellElement.BorderBottomWidth = 4 ' Setting to 1 or 2 didn't show
    e.CellElement.BorderLeftWidth = 0
    e.CellElement.BorderRightWidth = 0

    but either I cannot get anything to display until I set the bottom width to 4 pixels, or I get lots of other border items shown as well.

    Any ideas please?
  2. Stefan
    Stefan avatar
    2906 posts

    Posted 12 Mar 2015 Link to this post

    Hello Mark,

    The CellFormatting event is the right place for this - you are on the right path. The only thing you need to set is the BorderBoxStyle property as well:
    e.CellElement.DrawBorder = True
    e.CellElement.BorderBoxStyle = BorderBoxStyle.FourBorders
    e.CellElement.BorderBottomColor = Color.Red
    e.CellElement.BorderBottomWidth = 1
    e.CellElement.BorderTopWidth = 0
    e.CellElement.BorderLeftWidth = 0
    e.CellElement.BorderRightWidth = 0

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top