Changing the RadDatePicker Calendar Popup Icon

8 posts, 0 answers
  1. JT
    JT avatar
    49 posts
    Member since:
    Mar 2007

    Posted 02 Jul 2008 Link to this post

    I like to use the Web20 skin for the popup calendar itself in a RadDatePicker, but I prefer the calendar popup icons from the other skins. I know I can change the icon with the DatePopupButton-ImageUrl property, but I don't know how to reference the icons that are now embedded. Of course with the old ASP.NET controls, I had a folder and a file to point at. How do I access that resource now?

    Thanks!
  2. JT
    JT avatar
    49 posts
    Member since:
    Mar 2007

    Posted 02 Jul 2008 Link to this post

    I found this in my code where I set the RadAjaxPanel image to one of the embedded images. I'm hoping there's a similar method to change the RadDatePicker's calendar icon.

    RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") 

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 03 Jul 2008 Link to this post

    Hi Justin,

    In order to replace the default images for the date-picker pop-up, you will need to disable the internal skin (by setting EnableEmbeddedSkins to false) and use an external one of design a custom skin taking the css definitions/images of the built-in skin as a basis.

    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 03 Jul 2008 Link to this post

    Hi Justin,

    In order to replace the default images for the date-picker pop-up, you will need to disable the internal skin (by setting EnableEmbeddedSkins to false) and use an external one of design a custom skin taking the css definitions/images of the built-in skin as a basis.

    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. JT
    JT avatar
    49 posts
    Member since:
    Mar 2007

    Posted 03 Jul 2008 Link to this post

    Are there any plans to expose a method like RadAjaxLoadingPanel's GetWebResourceUrl()? That seems like a pretty elegant way to go about it. I mean, I could just set the skin to the calendar icon I like, right click and copy the WebResource.axd URL and set that as the ImageURL, right? But that's hardly ideal.
  7. JT
    JT avatar
    49 posts
    Member since:
    Mar 2007

    Posted 03 Jul 2008 Link to this post

    What is Telerik.Web.SkinManager? That class looks like it would have all the methods I'd need for getting the web resource URL for a calendar icon from one of the skins, but it doesn't appear to be exposed?
  8. Plamen Peshev
    Admin
    Plamen Peshev avatar
    886 posts

    Posted 07 Jul 2008 Link to this post

    Hi Justin,

    You can use GetWebResourceUrl - the GetWebResourceUrl method returns a URL reference to a resource embedded in an assembly. The returned reference is not URL encoded. Resources can be script files, images, or any static file. You specify the type based on the object that will be accessing the resource.

    A Web resource registered with the page is uniquely identified by its type and name. Only one resource with a given type and name pair can be registered with the page. Attempting to register a resource that is already registered does not create a duplicate of the registered resource.

    Here is an example:

    <%@ Page Language="C#" %> 
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
        <title>Untitled Page</title> 
        <script runat="server"
        protected void Page_Load(object sender, EventArgs e) 
        { 
            Image1.ImageUrl = Page.ClientScript.GetWebResourceUrl(typeof(RadCalendar), "Telerik.Web.UI.Skins.Hay.Calendar.datePickerPopup.gif"); 
        }     
        </script> 
    </head> 
    <body> 
        <form id="form1" runat="server"
            <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
            <div> 
                <asp:Image ID="Image1" runat="server" /> 
            </div> 
        </form> 
    </body> 
    </html> 
     



    For more information on using resources in applications, see ASP.NET Web Page Resources Overview.


    Best wishes,
    Plamen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. Bevan
    Bevan avatar
    4 posts
    Member since:
    Nov 2010

    Posted 06 Oct 2011 Link to this post

    I just read this post from Telerik which solved the problem:

    By default the icons for the datepicker popup are taken from the embedded skin in the RadCalendar assembly. If you want to change them you can use the ImageUrl and HoverImageUrl properties like this:

     <radCln:RadDatePicker ID="RadDatePicker1" runat="server">
            <Calendar Skin="Default"></Calendar>
            <DatePopupButton ImageUrl="~/RadControls/Calendar/Skins/Default/Img/datePickerPopupHover.gif" HoverImageUrl="~/RadControls/Calendar/Skins/Default/Img/datePickerPopupHover.gif" />
            </radCln:RadDatePicker>


    Let us know if we can be of further help.

    Kind regards,
    Steve
    the Telerik team

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017