RadRibbonSplitButton: Disable Button, but enable DropDown?

7 posts, 1 answers
  1. Erik
    Erik avatar
    7 posts
    Member since:
    Sep 2013

    Posted 20 Oct 2014 Link to this post

    Hi,

    I want to disable the button part of the RadRibbonSplitButton, if the default action is not valid. But at the same time some of the actions in the drop down part are valid. But when I disable the RadRibbonSplitButton, the dropw down "button" is disabled too. So the user can't choose an action from the dropdown.
     
    Is it possible to disable the button, but enable the dropdown?

    Erik    
  2. Answer
    Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1236 posts

    Posted 23 Oct 2014 Link to this post

    Hi,

    In order to achieve your requirements you can use the RadSplitButton.ButtonPartStyle property. You can use a custom Style targeting the RadButton (the button part of the split button) and control its IsEnabled property.

    <telerik:RadSplitButton Content="Toggle Part">
        <telerik:RadSplitButton.ButtonPartStyle>
            <Style TargetType="telerik:RadButton">
                <Setter Property="IsEnabled" Value="{Binding ElementName=Disable, Path=IsChecked, Mode=TwoWay}"/>
            </Style>
        </telerik:RadSplitButton.ButtonPartStyle>
    </telerik:RadSplitButton>
    Please give this approach a try and let me know if you need any further assistance.

    Regards,
    Pavel R. Pavlov
    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. Jiri
    Jiri avatar
    44 posts
    Member since:
    Oct 2013

    Posted 11 May in reply to Pavel R. Pavlov Link to this post

    Hi,

    I am trying this aproach, but it doesnt work wor me.
    Could you please elaborate more on how to achieve that effect - button disabled, dropdown enabled?

    Thank you,
    Jiri

  4. Milena
    Admin
    Milena avatar
    226 posts

    Posted 15 May Link to this post

    Hello Jiri, 

    You can set IsButtonPartVisible property of RadRibbonSplitButton to false. Then you can see only the DropDownPart (a toggle button) which the user can click in order to open the DropDownContent.

    If this does not work for you, please give us more detailed information about your scenario - what look and appearance and also behavior you need to achieve and what to remove from the default RadRIbbonSplitButton. Thank you in advance for your cooperation. 

    Regards,
    Milena
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  5. Jiri
    Jiri avatar
    44 posts
    Member since:
    Oct 2013

    Posted 15 May in reply to Milena Link to this post

    I want the behavior when user see the whole button only the button part is disabled and the toggle button is enabled, so user is forced to click only on the toggle button.
    And later I want the button part to set as Enabled as well, so user can click on both parts.
    Does it make sense now?

    Regrads,
    Jiri

     

  6. Milena
    Admin
    Milena avatar
    226 posts

    Posted 16 May Link to this post

    Hello Jiri,

    You can disable the button part and then enable it on some action/event. This is the approach which Pavel suggested in the first post. I attached a small project where the ButtonsPart of the first split button is disabled and then enabled when you choose the last ListboxItem from the DropDownContent. 

    Please take a look at the project and see if it works for you. 

    Regards,
    Milena
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  7. Jiri
    Jiri avatar
    44 posts
    Member since:
    Oct 2013

    Posted 16 May in reply to Milena Link to this post

    Hello Milena,

    Thank you, this works. I was a little confused by binding from original example, but now it's clear.

    Cheers,
    Jiri
Back to Top