How do I disable bound ComboBoxItems in WinUI 3

youki 1,021 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 development | Windows App SDK
Developer technologies | C++
Developer technologies | XAML
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.