Chris Andrews
Top achievements
Rank 1
Chris Andrews
asked on 05 Dec 2011, 08:25 PM
Hello All,
I am trying to display an icon in the RadTabControl, right aligned, at the tab strip level. I have done this with the RibbonBar using the TabStripAdditionalContent property, but in this particular view, I do not have a RibbonBar. I was wondering if there is a similiar property I can use to achieve this, or using a style / template.
Any help is appreciated.
Thanks in advance
I am trying to display an icon in the RadTabControl, right aligned, at the tab strip level. I have done this with the RibbonBar using the TabStripAdditionalContent property, but in this particular view, I do not have a RibbonBar. I was wondering if there is a similiar property I can use to achieve this, or using a style / template.
Any help is appreciated.
Thanks in advance
5 Answers, 1 is accepted
0
Hi Chris,
All the best,
Dimitrina
the Telerik team
Please find attached an example.
If you have further questions please do not hesitate to ask us.
I hope this will help you.
All the best,
Dimitrina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Chris Andrews
Top achievements
Rank 1
answered on 15 Dec 2011, 05:07 PM
Hello, thanks for the assistance.
Unfortunately this is not what I hoped to achieve. I can get the icon in the individual header just fine, however, I was just looking to place an icon all the way to the right. See attached screenshot for desired result.
Thanks Again,
Chris
Unfortunately this is not what I hoped to achieve. I can get the icon in the individual header just fine, however, I was just looking to place an icon all the way to the right. See attached screenshot for desired result.
Thanks Again,
Chris
0
Hello Chris Andrews,
Please check it out and let us know if it satisfies you.
Kind regards,
Petar Mladenov
the Telerik team
I prepared a project for you in which I've edited the default ControlTemplate of the RadTabControl like so (new items added with green background):
<
ControlTemplate
TargetType
=
"{x:Type telerik:RadTabControl}"
>
<
Grid
>
<
telerik:RadDockPanel
LastChildFill
=
"True"
>
<
telerik:LayoutTransformControl
x:Name
=
"HeaderDockedElement"
telerik:RadDockPanel.Dock
=
"Top"
IsTabStop
=
"False"
>
<
Grid
>
<
Border
x:Name
=
"HeaderBackground"
Background
=
"{TemplateBinding HeaderBackground}"
Visibility
=
"{TemplateBinding BackgroundVisibility}"
/>
<
Border
BorderBrush
=
"#FF848484"
BorderThickness
=
"0,0,0,1"
SnapsToDevicePixels
=
"True"
/>
<
telerik:RadDockPanel
Panel.ZIndex
=
"10"
>
<
StackPanel
Orientation
=
"Horizontal"
telerik:RadDockPanel.Dock
=
"Right"
Margin
=
"2,4,4,2"
>
<
ToggleButton
x:Name
=
"DropDownButtonElement"
ClickMode
=
"Press"
IsChecked
=
"{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Style
=
"{TemplateBinding DropDownButtonStyle}"
Visibility
=
"Collapsed"
>
<
telerik:RadContextMenu.ContextMenu
>
<
Telerik_Windows_Controls_TabControl:DropDownMenu
x:Name
=
"DropDownMenuElement"
ClickToOpen
=
"True"
DisplayMemberPath
=
"{TemplateBinding DropDownDisplayMemberPath}"
ItemTemplate
=
"{TemplateBinding ItemDropDownContentTemplate}"
Placement
=
"Bottom"
Style
=
"{TemplateBinding DropDownStyle}"
StaysOpen
=
"False"
/>
</
telerik:RadContextMenu.ContextMenu
>
</
ToggleButton
>
<
Image
Width
=
"16"
Height
=
"16"
Source
=
"Images/check.png"
/>
</
StackPanel
>
Petar Mladenov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Alfons
Top achievements
Rank 2
answered on 17 Aug 2012, 01:04 PM
Dear Petar,
I am not so familiar with templates (yet). But in your example project the template takes about 350 lines of code. Besides it is a lot of typing; all those hard coded settings in the style, is it still possible to apply some Theme to the TabControl?
Can't you create a style or template derived from the normal RadTabControl and only add a few extra lines to get the icon on the right side? If so, I would love to get an example.
I am not so familiar with templates (yet). But in your example project the template takes about 350 lines of code. Besides it is a lot of typing; all those hard coded settings in the style, is it still possible to apply some Theme to the TabControl?
Can't you create a style or template derived from the normal RadTabControl and only add a few extra lines to get the icon on the right side? If so, I would love to get an example.
0
Hello Alfons,
At the moment the only approach for adding additional content to the RadTabControl is by editing its default ControlTemplate. As we can see how this can be inconvenient, we have logged a feature request in our PITS to add ContentPresenters in the ControlTemplate of the TabControl to support additional content. However, so far this feature hasn't gathered much feedback. But you can vote for it to increase its priority in our to-do list.
As for theming, unfortunately with the current approach, you need to edit the RadTabControl.ControlTemplate defined in the appropriate theme style files. So if you're not using Office_Black, just let us know and we'll send over a modified ControlTemplate for the theme you're using in your application.
Kind regards,
Tina Stancheva
the Telerik team
At the moment the only approach for adding additional content to the RadTabControl is by editing its default ControlTemplate. As we can see how this can be inconvenient, we have logged a feature request in our PITS to add ContentPresenters in the ControlTemplate of the TabControl to support additional content. However, so far this feature hasn't gathered much feedback. But you can vote for it to increase its priority in our to-do list.
As for theming, unfortunately with the current approach, you need to edit the RadTabControl.ControlTemplate defined in the appropriate theme style files. So if you're not using Office_Black, just let us know and we'll send over a modified ControlTemplate for the theme you're using in your application.
Kind regards,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.