J
Jonathan Wood
Greetings,
On a GridView control, I want to show alternating colors. But instead of
alternating on each row, I want to alternate each group. So several items
would be one color and the next several items would be another color.
I'm able to accomplish this by setting the CssClass property in the
GridView's RowDataBound event handler.
But I also need the rows to be selectable so I set the CssClass for the
SelectedRowStyle at design time. The problem is that, when CssClass is set
in the RowDataBound event handler, that style is always used, even when the
row is selected. And these rows no longer provide any visual indication that
they are selected.
It appears that ASP.NET will not override a manually set CssClass with the
selected row CssClass.
Does anyone know how I could make this work?
Thanks.
On a GridView control, I want to show alternating colors. But instead of
alternating on each row, I want to alternate each group. So several items
would be one color and the next several items would be another color.
I'm able to accomplish this by setting the CssClass property in the
GridView's RowDataBound event handler.
But I also need the rows to be selectable so I set the CssClass for the
SelectedRowStyle at design time. The problem is that, when CssClass is set
in the RowDataBound event handler, that style is always used, even when the
row is selected. And these rows no longer provide any visual indication that
they are selected.
It appears that ASP.NET will not override a manually set CssClass with the
selected row CssClass.
Does anyone know how I could make this work?
Thanks.