RibbonComboBox's SelectedValue property issue
-
24-06-2021 - |
質問
I just started working in a WPF project using a Ribbon Bar, but I am stuck with the RibbonComboBox.
I need to add 3 items, so what I have done so far is:
<RibbonComboBox Name="phaseComboBox">
<RibbonGallery>
<RibbonGalleryCategory>
<RibbonGalleryItem>
Phase 1
</rb:RibbonGalleryItem>
<RibbonGalleryItem>
Phase 2
</RibbonGalleryItem>
<RibbonGalleryItem>
Phase 3
</RibbonGalleryItem>
</RibbonGalleryCategory>
<RibbonGallery>
</RibbonComboBox>
But I need the first element to get selected at first, so, I set the RibbonGalleryCategory
's SelectedValue
property to Phase 1
, but it never gets selected.
What am I doing wrong? It may be a very easy question, but it is the first time I develop a Ribbon Bar.
Thanks in advance.
解決
I have solved my problem:
I just have to set the IsSelected
property to True
in the element:
<RibbonGalleryItem Content="Phase 1" IsSelected="True" />
所属していません StackOverflow