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

RadComboBox problem when trying to create a template

1 Answer 48 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 28 Nov 2012, 06:11 PM
When I right click on a radcombobox and choose Edit a Copy, it doesn't show me the whole template for the box.  All I see is this:

<ControlTemplate x:Key="RadComboBoxControlTemplate1"
                     TargetType="telerik:RadComboBox" />

What I want to do is to put something like this into my Design Dictionary:

<Style x:Name="RadComboBoxTest"
           TargetType="telerik:RadComboBox">
        <Setter Property="CanAutocompleteSelectItems"
                Value="True" />
        <Setter Property="CanKeyboardNavigationSelectItems"
                Value="True" />
        <Setter Property="IsEditable"
                Value="True" />
        <Setter Property="IsReadOnly"
                Value="True" />
        <Setter Property="OpenDropDownOnFocus"
                Value="True" />
        <Setter Property="TextSearchMode"
                Value="StartsWith" />
        <Setter Property="ClearSelectionButtonVisibility"
                Value="Visible" />
        <Setter Property="ClearSelectionButtonContent"
                Value="Clear" />
    </Style>

I am probably not doing this right, but I need to make these values preset, so all of our RadComboBox controls can be standardized and reference the Template.

1 Answer, 1 is accepted

Sort by
0
Accepted
Vladi
Telerik team
answered on 03 Dec 2012, 01:07 PM
Hi Stephen,

Usually, the easiest way for templates customizations is to use Expression Blend to generate the needed templates and resources and then make your own customizations upon them. In Expression Blend open your Silverlight project, select RadComboBox in Objects and Timeline, right-click it and choose from the menu Edit Template-> Edit A Copy. Then Blend will generate all the necessary templates and resources and you can easily modify them. More information about customizing RadComboBox you could find in our online documentation. Keep in mind the visual state brushes come from the ButtonChrome control placed in a certain control template. And in most cases in order to customize how a control looks in a normal, mouse over or other state, the ButtonChrome should be styled.

If you do not want to use Blend you can get the same Styles from RadControls installation folder on your machine. There you will find a Themes folder. Drill down to the xaml file that corresponds to the control and its theme and you will have all needed resources for customizing the control manually.

Hope this is helpful.

Kind regards,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ComboBox
Asked by
Stephen
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Share this question
or