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
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
>
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.
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
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
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
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
Hello Milena,
Thank you, this works. I was a little confused by binding from original example, but now it's clear.
Cheers,Jiri