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

Using telerik skin on generic table

3 Answers 260 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Louis-Philippe
Top achievements
Rank 1
Louis-Philippe asked on 07 Mar 2011, 05:19 PM
Hello,
I'm trying to build user base theme into my application. I had no problem finding how to let the user choose a theme from the built-in themes collection, but I can't find a way to apply telerik's theme to generic table. I look into the forum and found similar questions, but no satisfying answer. Most post points to articles on how to modify built-in theme and how to create your own, but I'm looking on how to do the exact opposite, I want to use the built-in theme. There was one answer that seem to go into the right direction, but I guess I'm missing something... The example is:

<div class="RadGrid RadGrid_Default" style="width:400px">
<table class="MasterTable_Default" cellspacing="0" style="width:100%">
<tr>
    <th class="GridHeader_Default">header cell</th>
    <th class="GridHeader_Default">header cell</th>
</tr>
<tr class="GridRow_Default">
    <td>data cell</td>
    <td>data cell</td>
</tr>
<tr class="GridAltRow_Default">
    <td>data cell</td>
    <td>data cell</td>
</tr>
</table>
</div>
http://www.telerik.com/community/forums/aspnet-ajax/grid/applying-skin-to-generic-table-tags.aspx

So my question is how to apply a telerik built-in theme, let say Forest, at run-time to non telerik control such as generic and asp table?
Thanks for your help,
Louis-Philippe

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 10 Mar 2011, 11:53 AM
Hello Louis-Philippe,

Since a generic table does not have the built-in class names of RadGrid, you need to assign them to each of its elements. The only thing here is the sample code uses the old class names. You can find a runnable sample demonstrating the approach with the new class names attached to this project.

Greetings,
Tsvetina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Louis-Philippe
Top achievements
Rank 1
answered on 10 Mar 2011, 08:32 PM
Hello,
I looked at the sample project, it's closer to the goal, but not exactly what I'm looking for. The example is
<div class="RadGrid_WebBlue" style="width: 400px">
      <table class="RadGrid_WebBlue rgMasterTable" cellspacing="0" style="width: 100%">
          <tr>
              <th class="RadGrid_WebBlue rgHeader">
                  header cell
              </th>
              <th class="RadGrid_WebBlue rgHeader">
                  header cell
              </th>
          </tr>

Since I want to use on the fly theme assignment, I can't use something like 'class="RadGrid_WebBlue" ', because the type of theme to use while only be known at run time. What I'm looking for is something like:

<div class="RadGrid_Current_Theme" style="width: 400px">
        <table class="RadGrid_Current_Theme rgMasterTable" cellspacing="0" style="width: 100%">
            <tr>
                <th class="RadGrid_Current_Theme rgHeader">
                    header cell
                </th>
                <th class="RadGrid_Current_Theme rgHeader">
                    header cell
                </th>
            </tr>

Is this scenario possible? My pages contain both a RadSkinManager and a RadFormDecorator, witch are located in my default.Master base page and is use to set the theme for the entire site. The idea, would be to use those control to ether set the table skins or at least to the get informations on the selected theme and apply it.

Thank you for your time,
Louis-Philippe
0
Tsvetina
Telerik team
answered on 11 Mar 2011, 01:06 PM
Hello Louis-Philippe,

The RadSkinManager control is designed only for skinning RadControls, it cannot apply skins to other controls which do not have the proper class names set to their elements.

Additionally, if you want to dynamically change the class names in the table, what I see as a possibility would be to traverse the table element and set the names accordingly through client script. 

Regards,
Tsvetina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
General Discussions
Asked by
Louis-Philippe
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Louis-Philippe
Top achievements
Rank 1
Share this question
or