Click here to Skip to main content
14,879,120 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Greatings All,

This is my first post on the board. I am a Newbie to WPF and C# programming and I have been trying my best to learn as I go. Currently I am working on a project for work and I hit a stumbling block. I have 2 Checkcombobox controls I have populated with data. The first checkcombobox has one selection item in the list that I would like to trigger the 2nd Checkcombobox to become fully active. My controls have been set to show the dropdowns when my form starts without having to click the dropdown arrow. The issue I have been having is preventing click activity in the 2nd dropdown when IsEnabled=false from my C# code file. You can still click selections in Checkcombobox 2 dropdown even though it has been disabled. In the control template I changed this line:

<ItemsPresenter x:Name="PART_ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" IsEnabled="False"/>


The control now blocks the click activity which is what I was after. The question is, how do I revert this back to an enabled state when this criteria is met?

public void Modality_Select_ItemSelectionChanged_1(object sender, Xceed.Wpf.Toolkit.Primitives.ItemSelectionChangedEventArgs e)
       {
           if (Modality_Select.SelectedItems.Contains("EMG"))
           {
               EMG_LB.IsEnabled = true;
               EMG_Type.IsEnabled = true;


           }
           else
           {

               EMG_Type.SelectedItem = null;
               EMG_LB.IsEnabled = false;
               EMG_Type.IsEnabled = false;


           }


Modality_Select is Checkcombobox 1 and EMG_Type is Checkcombobox 2.

Any help is greatly appreaciated. Please keep in mind I am still early on the learning curve, therefore easily lost.

Thank you,

Patrick
Posted
Comments
Kevin Marois 25-Aug-15 11:17am
   
Are you using the Checkcombobox from the Extended Toolkit?
Member 11695285 25-Aug-15 12:08pm
   
Yes, I am using the controls from the Xceed Extended WPF toolkit

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900