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

Icon and Title in one TitlebarContainer

2 Answers 84 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Malichone
Top achievements
Rank 1
Malichone asked on 08 Jan 2010, 09:25 PM
Is there any way to have an icon AND the title text visible in a single docks titlebarContainer? 

2 Answers, 1 is accepted

Sort by
0
Accepted
Pero
Telerik team
answered on 12 Jan 2010, 02:26 PM
Hi Malichone,

Depending on your specific scenario you could try the following suggestions:
  • Use a custom DockCommand to serve as an icon. You need to apply the following CSS class to the DockCommand and the custom image will be applied:
    <style type="text/css">
        .MyCustomStyle
        {
            width: 19px;
            height: 19px;
            background: url(Icons/zoom_in.png) no-repeat !important;
        }
    </style>
    To add custom DockCommand use the dock's <Commands> tag.
  • Place an <image> or <asp:Image> in the TitlebarContainer that will serve as an icon and <asp:Label> to contain the Title text.

Please do not hesitate to contact us, in case you have any other questions.


All the best,
Pero
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Malichone
Top achievements
Rank 1
answered on 12 Jan 2010, 07:56 PM
"Place an <image> or <asp:Image> in the TitlebarContainer that will serve as an icon and <asp:Label> to contain the Title text."

This led us into the direction that we implemented. In our extended radDock control we added the following:
        private Image _widgetIcon;  
        public Image widgetIcon  
        {  
            get 
            { return _widgetIcon; }  
        }  
 
        private Label _WidgetTitle;  
        public Label WidgetTitle  
        {  
            get 
            { return _WidgetTitle; }  
        }  
 
        public NCSBlackRadDock() : base()  
        {  
            // INCLUDE A WIDGET SPECIFIC ICON (IF AVAILABLE)  
            _widgetIcon             = new Image();  
            _widgetIcon.ID          = "WidgetIcon";  
            _widgetIcon.ImageUrl    = String.Empty;  
            _widgetIcon.CssClass    = "WidgetIcon";  
            this.TitlebarContainer.Controls.Add(_widgetIcon);  
 
            // INCLUDE A WIDGET SPECIFIC TITLE (IF AVAILABLE)  
            _WidgetTitle            = new Label();  
            _WidgetTitle.ID         = "WidgetTitle";  
            _WidgetTitle.Text       = String.Empty;  
            this.TitlebarContainer.Controls.Add(_WidgetTitle);  
        }  
 

and in our web page we consume these objects like:
 NCSBlackRadDock dock = new NCSBlackRadDock();  
 dock.widgetIcon.ImageUrl = "~/Prototype/Modules/HttpWebRequest/Images/Config.png";  
 dock.WidgetTitle.Text = "Critical Printers";  
 

to get the icon and the title on the widget titlebar.
Tags
Dock
Asked by
Malichone
Top achievements
Rank 1
Answers by
Pero
Telerik team
Malichone
Top achievements
Rank 1
Share this question
or