Hi.
I'm trying to style my RadGrid, but for some strange reason, only about half the styling is working correctly. Could you guys tell me what I'm doing wrong?
For the header of the grid, I want to make these changes:
Change the font color (works)
Change the background color (doesn't work)
Make the header text bold (doesn't work)
Change the color of the border around the header cells (doesn't work)
For the rows of the grid, I want to make these changes:
Change the background color of a cell based on its value (works)
Change the row background color (works)
Change the color and style of the border around the row cells (doesn't work)
Also, with this theme (MetroTouch), the grid only has a border (bottom, right and left, nothing on top) on every other row and it disappears on mouseover of that row. I want these lines to always be visible.
Any help would be greatly appreciated. :)
I'm trying to style my RadGrid, but for some strange reason, only about half the styling is working correctly. Could you guys tell me what I'm doing wrong?
For the header of the grid, I want to make these changes:
Change the font color (works)
Change the background color (doesn't work)
Make the header text bold (doesn't work)
Change the color of the border around the header cells (doesn't work)
For the rows of the grid, I want to make these changes:
Change the background color of a cell based on its value (works)
Change the row background color (works)
Change the color and style of the border around the row cells (doesn't work)
Also, with this theme (MetroTouch), the grid only has a border (bottom, right and left, nothing on top) on every other row and it disappears on mouseover of that row. I want these lines to always be visible.
Private
Sub
rgProjects_ItemCreated(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridItemEventArgs)
Handles
rgProjects.ItemCreated
If
TypeOf
e.Item
Is
GridHeaderItem
Then
Dim
headerItem
As
GridHeaderItem =
CType
(e.Item, GridHeaderItem)
headerItem.ForeColor = System.Drawing.Color.FromArgb(226, 233, 243)
headerItem.BackColor = System.Drawing.Color.FromArgb(0, 82, 136)
headerItem.Font.Bold =
True
headerItem.BorderColor = System.Drawing.Color.FromArgb(183, 198, 203)
End
If
End
Sub
Private
Sub
rgProjects_ItemDataBound(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridItemEventArgs)
Handles
rgProjects.ItemDataBound
If
TypeOf
e.Item
Is
GridDataItem
Then
Dim
dataItem
As
GridDataItem =
CType
(e.Item, GridDataItem)
'dataItem.Font.Bold = True
Dim
myCell
As
TableCell = dataItem(
"DCounter"
)
If
myCell.Text.StartsWith(
"-"
)
Then
myCell.BackColor = System.Drawing.Color.Red
End
If
If
dataItem.ItemIndex
Mod
2 = 0
Then
dataItem.BackColor = System.Drawing.Color.FromArgb(226, 233, 243)
dataItem.BorderColor = System.Drawing.Color.FromArgb(183, 198, 203)
dataItem.BorderStyle = BorderStyle.Solid
Else
dataItem.BackColor = System.Drawing.Color.White
dataItem.BorderColor = System.Drawing.Color.FromArgb(183, 198, 203)
dataItem.BorderStyle = BorderStyle.Solid
End
If
End
If
End
Sub
Any help would be greatly appreciated. :)