Is RadSplitButton.DefaultItem in WPF?

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    10 posts
    Member since:
    Jul 2012

    Posted 10 Jan 2013 Link to this post

    The Working with RadSplitButton Items webpage shows a DefaultItem property for RadSplitButton. Is this available in the WPF RadSplitButton? It doesn't appear so.

    I have the need for this functionality in our MVVM WPF application (using Caliburn Micro as our MVVM framework).

    In the Style for this control, I can set a property as shown below:

    <Setter Property="cal:Message.Attach" Value="[Event Click]=[Action CreateNewLink2]"/>

    CreateNewLink2 is fired when I click the button without dropping down the control, but if I create a guard property for this method, the entire control is disabled. I need the dropdown to dropdown even when the guard property prevents executing the command (CreateNewLink2) since there are commands on the dropdown that can be enabled even when the CreateNewLink2 (command for the button) is disabled.

    Can this be done?
  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1167 posts

    Posted 11 Jan 2013 Link to this post

    Hello Kevin,

    The DefaultItem property is available in our WinForms controls only. Our WPF RadSplitButton is composed of a RadButton (which executes the Command) and a RadToggleButton (which opens the DropDown content). In order to achieve your goal I extracted the default template of the control and I bound the IsEnabled properties of the RadButton and the RadToggleButton to properties defined in the DataContext of the RadSplitButton. You can apply the same logic to bind the Command property of both buttons to different command instances.

    Please take a look at the attached project and let me know if it works for you.

    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top