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

[Solved] Multiple Grids on one page AND have separate styling?

4 Answers 267 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel
Top achievements
Rank 1
Daniel asked on 22 Mar 2011, 10:36 PM
I have two grids on one page (within a TabStrip()).  Is it possible for each to use a separate stylesheet?  In other words, I want one Grid to be blue and one to be green.  I feel I know the answer, but I am strongly hoping there is a solution that doesn't involve iFrames.

Thanks!
Daniel

4 Answers, 1 is accepted

Sort by
0
Mylène
Top achievements
Rank 1
answered on 21 Apr 2011, 10:22 AM
Hi,

Any new about this ? I'm in the same case and would like to know if there is any issues.

Thanks
0
Dimo
Telerik team
answered on 21 Apr 2011, 12:02 PM
Hello,

The requested behavior is possible to achieve. You need to place the two Grids in containers with some different CSS classes...

<div class="skin1">
    <%= Html.Telerik().Grid().Name("Grid1") %>
</div>
 
<div class="skin2">
    <%= Html.Telerik().Grid().Name("Grid2") %>
</div>


...and modify the MVC extension skins like this, so that the CSS classes above take part in each selector, for example:

telerik.skin-name-1.css

.skin1  .t-widget
{
        /* styles remain unchanged */
}


telerik.skin-name-2.css

.skin2  .t-widget
{
        /* styles remain unchanged*/
}


Actually, you can leave the skin that you are using more unchanged, while adding a custom CSS class only to the one that you need for one of the Grids.

It is up to you to decide whether this approach is easier for you than using iframes.



Best wishes,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Mieke
Top achievements
Rank 1
answered on 03 May 2011, 03:10 PM
Thanks.
It works very well for styling the grid. But how do I style the popup window if I edit a record?

Kind regards,
Mieke
0
Dimo
Telerik team
answered on 03 May 2011, 04:04 PM
Hi Mieke,

The Grid popup is actually a Window component, so the styling and required CSS classes are the same.

All the best,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Mylène
Top achievements
Rank 1
Dimo
Telerik team
Mieke
Top achievements
Rank 1
Share this question
or