More in this section

Forums / General Discussions / How do I change the default widget icon for a custom user control?

How do I change the default widget icon for a custom user control?

8 posts, 1 answered
  1. Dan Sorensen
    Dan Sorensen avatar
    256 posts
    Registered:
    13 Aug 2010
    08 Feb 2011
    Link to this post
    How do I change the default widget icon in the "Drag Widgets" pane for a custom user control that I have built and installed? The default icon is a dashed square. I would like to provide my own image instead.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    10 Feb 2011
    Link to this post
    Hi Dan,

    When you register a widget you can set the CssClass property. You should load the css class on the page. This will allow you to set image url.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Dan Sorensen
    Dan Sorensen avatar
    256 posts
    Registered:
    13 Aug 2010
    17 Feb 2011
    Link to this post
    Cool - that works for any of the built in icons. Is there a way for me to append my own icon to that sprite sheet or do I need to include a separate icon image in the CSS?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 Feb 2011
    Link to this post
    Hi Dan,

    You should load your custom stylesheet where you reference your image. This will allow you to override the default image.

    All the best,
    Ivan Dimitrov
    the Telerik team
  5. Thiago Santos
    Thiago Santos avatar
    1 posts
    Registered:
    08 Feb 2007
    24 Mar 2011
    Link to this post
    Hello admin

    Can you publish a css  demonstrating how we can accomplish that?

    Thanks a lot

    Thiago Santos
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    28 Mar 2011
    Link to this post
    Hi ,

    If you are going to use sprite images you should set background with an !important for the following classes

    RadDock_Sitefinity .rdTable .rdTitleBar div

    All the best,
    Ivan Dimitrov
    the Telerik team
  7. Victor
    Victor avatar
    15 posts
    Registered:
    24 Mar 2011
    29 Mar 2011
    Link to this post
    Has anyone found an example of this?
  8. readonlychild
    readonlychild avatar
    1 posts
    Registered:
    01 Mar 2011
    06 Apr 2011
    Link to this post
    this is what I do:

    i. put this in a .css file (embedded in dll, so the WebResource instruction is subtituted)
    .sfWidgetsWrp div.BannerImage           { width:195px;height:40px;min-height:40px;margin:0px; background-image: url('<%=WebResource("Namespace.Resources.icon.png")%>') !important; background-repeat:no-repeat !important; }

    ii. while I'm at ToolboxesConfig.config, I set cssClass to "BannerImage"

    iii. you need to figure out how to load the css file in the designer... what I do is I include a widget in the template so it'll load on all the pages, which will pull the css file into context. 

8 posts, 1 answered