When RadGrid renders, it inspects its SkinID and puts some default CssClass definitions in for you. This is fine. Apparently when it's setting the CssClass name to say, "RadGrid_Default", it first checks for the existence of "RadGrid_*" classes and removes them. I would expect this to happen. I assume it uses a regex that looks for:
conditional leading spaces + "RadGrid_" + some characters + conditional trailing spaces.
Unfortunately this is not good enough as it might incorrectly remove parts of classes that contain this string. Take "MyLongerNamedRadGrid_Default" for example. If I had this CssClass, and didn't set a SkinID, I could then inspect the ViewSource and find that it has "RadGrid_Default MyLongerNamed" as my
class attribute.
A simple fix might be to make those conditional leading/trailing spaces manditory, and to pad the cssClass with a leading/trailing space. Then at the end, trim the cssClass back down again. This way you can find the exact string your looking for.
conditional leading spaces + "RadGrid_" + some characters + conditional trailing spaces.
Unfortunately this is not good enough as it might incorrectly remove parts of classes that contain this string. Take "MyLongerNamedRadGrid_Default" for example. If I had this CssClass, and didn't set a SkinID, I could then inspect the ViewSource and find that it has "RadGrid_Default MyLongerNamed" as my
class attribute.
A simple fix might be to make those conditional leading/trailing spaces manditory, and to pad the cssClass with a leading/trailing space. Then at the end, trim the cssClass back down again. This way you can find the exact string your looking for.