Setting proper Skin Class on ListView

2 posts, 0 answers
  1. TechSavvySam
    TechSavvySam avatar
    38 posts
    Member since:
    Jul 2009

    Posted 20 May 2011 Link to this post

    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).


  2. TechSavvySam
    TechSavvySam avatar
    38 posts
    Member since:
    Jul 2009

    Posted 20 May 2011 Link to this post

    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>
    .
    .
    .
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top