This is a migrated thread and some comments may be shown as answers.

Row border - visibility and colors

1 Answer 405 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 09 Mar 2015, 08:24 PM
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

and

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?
       

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 12 Mar 2015, 11:26 AM
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.

Regards,
Stefan
Telerik
 

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.

 
Tags
GridView
Asked by
Mark
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or