The symptoms:
I want the background of the selected rows to be yellow.
It works only on the selected rows, that aren't an alternate rows.
The problem:
the method "GetRowClass", which determines the ClassName for the appropriate RowState, using all the options of the enumeration of DataControlRowState (except normal).
However, there is another option: "Selected | Alternate". Since its nor Selected neither Alternate, The Switch doesn't get them in either CASE. Therefore it returns the ClassName as NULL (or: "").
The solution:
One simple way, that demonstrate the problem and the solution is by adding these lines after the last Case. That should resolve the problem:
case DataControlRowState.Normal:
break;
default:
className += " AspNet-GridView-Selected ";
className += gridView.SelectedRowStyle.CssClass;
break;
Hope this helps.