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

RadRibbonSplitButton: Disable Button, but enable DropDown?

6 Answers 441 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 20 Oct 2014, 02:47 PM
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    

6 Answers, 1 is accepted

Sort by
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 23 Oct 2014, 09:09 AM
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.

 
0
Jiri
Top achievements
Rank 1
answered on 11 May 2017, 11:39 AM

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

0
Milena
Telerik team
answered on 15 May 2017, 10:28 AM
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.
0
Jiri
Top achievements
Rank 1
answered on 15 May 2017, 01:13 PM

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

 

0
Milena
Telerik team
answered on 16 May 2017, 07:29 AM
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 you to write beautiful native mobile apps using a single shared C# codebase.
0
Jiri
Top achievements
Rank 1
answered on 16 May 2017, 09:41 AM

Hello Milena,

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

Cheers,
Jiri
Tags
RibbonView and RibbonWindow
Asked by
Erik
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Jiri
Top achievements
Rank 1
Milena
Telerik team
Share this question
or