WPF - RadButton command contained within RadDropDownButton does not fire

0 Answers 101 Views
Forum suggestions
Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
Ohad asked on 07 Feb 2022, 03:00 PM | edited on 08 Feb 2022, 10:54 AM

Hi,

After all sorts of tests, I came to the final conclusion.

When I work this way:

  <telerik:RadButton
      Content="Clone"
      Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=DataContext.CloneCommand}"
      CommandParameter="{Binding}">
  </telerik:RadButton>

The Command is called properly.

But when I put it inside RadDropDownButton:

   <telerik:RadDropDownButton>
       <telerik:RadDropDownButton.DropDownContent>
           <telerik:RadButton
               Content="Clone"
               Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=DataContext.CloneCommand}"
               CommandParameter="{Binding }" >
           </telerik:RadButton>
       </telerik:RadDropDownButton.DropDownContent>
   </telerik:RadDropDownButton>


The Command doesn't fire

Would appreciate help,

Thanks,

Martin Ivanov
Telerik team
commented on 10 Feb 2022, 12:56 PM

I've tested your code snippet, but the command is executed as expected. You can take a look at the attached project and let me know if I am missing anything. Also, you can check the Output pane of Visual Studio on your side for any binding errors.

No answers yet. Maybe you can help?

Tags
Forum suggestions
Asked by
Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
Share this question
or