Using RibbonControlServcie.Label with a ComboBox in the Ribbon

Ribbon for WPF Forum

Posted 3 years ago by Eric P
Version: 16.1.0633
Avatar

So I am trying to add controls like TextBox, ComboBox, and a DateTime control to the Ribbon. I started using the controls in the editor namespace and this is what I have so far.

<ribbon:Group Label="Notes>
  <ribbon:StackPanel>
    <editors:TextBox Width="150" ribbon:RibbonControlServcie.Label="Name" />
    <ribbon:ComboBox Width="150" ribbon:RibbonControlServcie.Label="Folder" />
  </ribbon:StackPanel>
</ribbon:Group>

I can see the Name label next to the TextBox in the Ribbon but I do not see the Folder lable next to the ComboBox. I realize that this is becasue the RibbonControlServcie.Label only works on controls in the editors namespace, correct? The ComboBox needs to display a list of strings so what are my options for getting the label next to the ComboBox like the other controls? I realize I can just add a normal TextBlock to the left of the CombBox to achieve this but I wanted to make sure there was not an Actipro control that would do the same. Why is there not a ComboBox or something like a StringsEditBox control in the editors namespace?

Thanks,

   -eric

Comments (1)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Eric,

The RibbonControlService.Label should work with any control.  In your scenario, I think it's probably due to variants.  Try setting ItemVariantBehavior="AlwaysMedium" on your StackPanel.  That gets both showing in my case.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.