How do I disable bound ComboBoxItems in WinUI 3

youki 996 Reputation points
2023-02-24T21:57:05.63+00:00

Hi,

I have a bound ComboBox with separators and i want to disable them.

I am getting the item by ItemContainerGenerator to disable them but if I scroll the dropdown of the ComboBox up and down, the disabled items getting enabled.

Is this the proper way to do it or does this work in C# and it's a bug in C++/WinRT?

Please watch the demo video:
https://github.com/yki5000/WinUI3_Unpackaged_CPP/issues/2

It seems to work as expected on the MainWindow.xaml (the main page) page but the ComboBox from the video is on an other page and is called by a frame in MainWindow.xaml.

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
722 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,523 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
762 questions
{count} votes