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

Rounded Corner on RadComboBox

3 Answers 621 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 03 Mar 2015, 09:45 PM
I want to round the corners on a RadComboBox, but I don't want to go through and edit the template for it. Is there way to do that without going through the hassle of doing that? Potentially just using a setter property or something to do it on the xaml side?

thanks.

3 Answers, 1 is accepted

Sort by
0
Accepted
Nasko
Telerik team
answered on 05 Mar 2015, 03:00 PM
Hi Brett,

In order to achieve the desired appearance you could set the CornerRadius property of the ButtonChrome situated inside the NonEditableComboBox Template to the desired value. In code behind you could do that by hooking to the Loaded event with the following implementation:

private void DiskChoices_Loaded(object sender, RoutedEventArgs e)
{
    var radComboBox = sender as RadComboBox;
 
    var buttonChrome = radComboBox.Template.FindName("ButtonChrome",radComboBox) as ButtonChrome;
    buttonChrome.CornerRadius = new CornerRadius(10, 10, 10, 10);
}

Hopes this helps.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Brett
Top achievements
Rank 1
answered on 05 Mar 2015, 08:38 PM
Your answer did work, but how can I move that into a behavior in XAML code?
0
Accepted
Nasko
Telerik team
answered on 10 Mar 2015, 08:16 AM
Hello Brett,

You could create an attached property for setting the desired CornderRadius in order to extend the functionality of RadComboBox - thus you would be able to move that setting of the CornerRadius in Xaml code. 

We have created a sample project that demonstrates that approach - please, check it.

We hope this will help you.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ComboBox
Asked by
Brett
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Brett
Top achievements
Rank 1
Share this question
or