Thursday, February 19, 2009

GridLines style in Gridview

A fast way to change the style of the gridlines in a gridview:


Protected Sub gwMyGw_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles gwMyGw.PreRender

'PreRender event!
Dim tblStyle As New TableItemStyle()
tblStyle.BorderColor = Drawing.Color.White
tblStyle.BorderWidth = "2"

Dim row As TableRow
For Each row In Me.gwMyGw.Rows
Dim cel As TableCell
For Each cel In row.Cells
cel.ApplyStyle(tblStyle)
Next
Next

End Sub



Enjoy !

2012 | aspnet code by Michele | don't try this at home
Mirko Iodice Notageek
Vladimir Carrer Carrer web log