Calendar.CssClass has no effect

4 posts, 0 answers
  1. Laurens
    Laurens avatar
    12 posts
    Member since:
    Sep 2013

    Posted 09 Dec 2013 Link to this post

    Hi,

    I create my custom Telerik Skins with ASP.Net Themes. I have a .skin file resembling the snippet beneath. 

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
     
    <telerik:RadDatePicker runat="server" EnableEmbeddedSkins="false"
               CssClass="RadPicker_Laurens" SkinID="Laurens">
        <DateInput CssClass="RadInput_Laurens"
            DisabledStyle-CssClass="RadInput_Disabled_Laurens"
            EmptyMessageStyle-CssClass="RadInput_Empty_Laurens"
            EnabledStyle-CssClass="RadInput_Enabled_Laurens"
            FocusedStyle-CssClass="RadInput_Focused_Laurens"
            HoveredStyle-CssClass="RadInput_Hover_Laurens"
            InvalidStyle-CssClass="RadInput_Error_Laurens"
            ReadOnlyStyle-CssClass="RadInput_Read_Laurens">
        </DateInput>
        <Calendar CssClass="RadCalendar_Laurens">
        </Calendar>
    </telerik:RadDatePicker>

    The problem is that all the named cssClasses (except "RadPicker_Laurens") aren't loaded into the Html. I get a transperant looking calendar. With 'Developers Tools' I cannot find "RadCalender_Laurens".

    Perhaps noteworthy: my Telerik version is 2011.2.915.40
  2. Laurens
    Laurens avatar
    12 posts
    Member since:
    Sep 2013

    Posted 11 Dec 2013 Link to this post

    I´m able to set the Calendar css by
    ...
    <Calendar >
        <ClientEvents OnLoad="function(sender, args){ sender.addCssClass('RadCalendar_Laurens'); }" />
    </Calendar>
    ...
    which isn´t a pretty solution at all, but it works.

    A similar problem comes with the DateInput, 
    this:
    ...
    <DateInput CssClass="RadInput_Laurens" />
    ...
    will generate in html the following:
    ...
    <span ... class="RadInput RadInput_Default" ...>
        <input type="text" ... class="riTextBox riEnabled RadInput_Laurens" ... />
        ...
    </span>
    ...
    This seems rather incorrect, RadInput_Laurens should be next to RadInput_Default.

    Any clues?
    Thanks in advance.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Galin
    Admin
    Galin avatar
    526 posts

    Posted 12 Dec 2013 Link to this post

    Hi Laurens,

    The еаsiest way to achieve this behavior is to set the Skin to Laurens, e.g.
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server" EnableEmbeddedSkins="false" Skin="Laurens" />

    I hope this helps.

    Regards,
    Galin
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  5. Laurens
    Laurens avatar
    12 posts
    Member since:
    Sep 2013

    Posted 12 Dec 2013 Link to this post

    I never thought that would work with themes, but it did however! 
    All this trouble... Derp.
    Anyway, thanks a lot!
Back to Top