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

Setting proper Skin Class on ListView

1 Answer 77 Views
ListView
This is a migrated thread and some comments may be shown as answers.
TechSavvySam
Top achievements
Rank 1
TechSavvySam asked on 20 May 2011, 09:07 PM
referencing your example:

http://demos.telerik.com/aspnet-ajax/listview/examples/definingstructure/declarativedefinition/defaultcs.aspx

you use this bit of markup:

  <LayoutTemplate>
                    <div class="RadListView RadListView_<%#Container.Skin %>">


When I use the exact same code in my page the result renders as:

  <LayoutTemplate>
                    <div class="RadListView RadListView_Default">


Even though the page is using the Sunset skin and buttons are rendering on the page properly with the Sunset skin.

If I hard code this in the page:

  <LayoutTemplate>
                    <div class="RadListView RadListView_Sunset">

It works exactly as I want (but obviously won't work if we change the site's Skin).


1 Answer, 1 is accepted

Sort by
0
TechSavvySam
Top achievements
Rank 1
answered on 20 May 2011, 11:21 PM
I figured out what you're doing in the example.

You have a prerender function that sets the Skin for the ListView control that is then referenced in the <Layout> section.  I added this code to my program (along with code to set this value and it works now)


Protected Overrides Sub Page_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles Me.PreRender
    MyBase.Page_PreRender(sender, e)
    rlvCustomers.Skin = TelerikSkin
End Sub

I set the value TelerikSkin in my Page base class that is inherited by this page.

then, this works in the markup:

               <telerik:RadListView ID="rlvCustomers" runat="server" ItemPlaceholderID="itemPlaceholder">
                    <LayoutTemplate>
                        <div>
                            <table class="RadListView RadListView_<%#Container.Skin %>">
                                <tr id="itemPlaceholder" runat="server" />
                            </table>
                        </div>
                    </LayoutTemplate>
.
.
.
Tags
ListView
Asked by
TechSavvySam
Top achievements
Rank 1
Answers by
TechSavvySam
Top achievements
Rank 1
Share this question
or