I have a situation where I am generating a RadGrid control dynamically, and am seeing two issues:
1) The alternating rows are not working correctly - both rows and alternating rows have a white background; and
2) I am unable to change the background color programmatically.
I have a feeling #1 is interfering with #2, but can't figure out why. This is the code I use to generate the RadGrid:
You can see everything I've tried here, like enabling alternating items in the client settings, changing the back color of alternating items in the RadGrid (and in the MasterTableView as well), etc. But nothing seems to work. I've tried some rudimentary CSS changes, but haven't had luck with that either.
In the item data bound event I've tried using e.Item.BackColor, as well as assigning e.item to an object of type GridDataItem and then setting the back color of that object. Neither of these has worked, even though when debugging I see it changing the back color in the code. Like I said before, I wonder if #1 above is interfering with #2, but that's why I'm posting here. Any help is appreciated.
1) The alternating rows are not working correctly - both rows and alternating rows have a white background; and
2) I am unable to change the background color programmatically.
I have a feeling #1 is interfering with #2, but can't figure out why. This is the code I use to generate the RadGrid:
With rgStatusCenterMessages .ID = Me.ID & "_RadGrid" .AlternatingItemStyle.BackColor = Drawing.Color.LightGray .Width = Unit.Percentage(99) .AllowSorting = False .AllowPaging = True .PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric .AutoGenerateColumns = False .GroupingEnabled = True .ShowGroupPanel = False .ShowStatusBar = False With .ClientSettings .AllowDragToGroup = False .EnableAlternatingItems = True End With With .MasterTableView .AlternatingItemStyle.BackColor = Drawing.Color.Aqua .PageSize = 15 .ShowGroupFooter = False .GroupsDefaultExpanded = True .GroupLoadMode = GridGroupLoadMode.Client Dim groupBy As GridGroupByExpression = GridGroupByExpression.Parse("AppName [Group] Group By AppName") .GroupByExpressions.Add(groupBy) .DataKeyNames = New String() {"FormNo"} End With End With
You can see everything I've tried here, like enabling alternating items in the client settings, changing the back color of alternating items in the RadGrid (and in the MasterTableView as well), etc. But nothing seems to work. I've tried some rudimentary CSS changes, but haven't had luck with that either.
In the item data bound event I've tried using e.Item.BackColor, as well as assigning e.item to an object of type GridDataItem and then setting the back color of that object. Neither of these has worked, even though when debugging I see it changing the back color in the code. Like I said before, I wonder if #1 above is interfering with #2, but that's why I'm posting here. Any help is appreciated.