This is a migrated thread and some comments may be shown as answers.

RadGrid CssClass/SkinID

3 Answers 240 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian Mikesell
Top achievements
Rank 1
Brian Mikesell asked on 28 May 2008, 07:59 PM
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.

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 29 May 2008, 12:26 PM
Hi Brian,

RadGrid_Name is the grid main wrapper's CSS class, which also indicates the skin in use. Indeed, if you set a CSS class in the following format - *RadGrid_*, it will be stripped

However, if you insist on having a CSS class resembling the control's native CSS class naming convention, you can use MyLongerNamedGrid_Default  (without "Rad").

All the best,
Dimo
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Brian Mikesell
Top achievements
Rank 1
answered on 11 Jun 2008, 05:10 PM
Naturally this would "get me around" this issue, but you can't deny that this behavior is both unexpected and undesired.  I have included the "pseudo code" fix in my previous post.  I guess opening an issue in issue-tracker would be the most appropriate way of going about this.  I'll look around the site to see how this is done here at telerik.

Thanks.
0
Dimo
Telerik team
answered on 13 Jun 2008, 10:50 AM
Hello Brian,

We discussed this issue with our RadGrid developers and the final resolution is that the "RadGrid_Something" string is reserved and cannot be used in custom CSS classes. I am sorry for any inconvenience caused.

All the best,
Dimo
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Brian Mikesell
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Brian Mikesell
Top achievements
Rank 1
Share this question
or