Rounded Corner on RadComboBox

4 posts, 2 answers
  1. Brett
    Brett avatar
    5 posts
    Member since:
    Mar 2015

    Posted 03 Mar 2015 Link to this post

    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.
  2. Answer
    Nasko
    Admin
    Nasko avatar
    588 posts

    Posted 05 Mar 2015 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Brett
    Brett avatar
    5 posts
    Member since:
    Mar 2015

    Posted 05 Mar 2015 in reply to Nasko Link to this post

    Your answer did work, but how can I move that into a behavior in XAML code?
  5. Answer
    Nasko
    Admin
    Nasko avatar
    588 posts

    Posted 10 Mar 2015 Link to this post

    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.

     
Back to Top