Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: CheckComboBox enqueries

$
0
0
Hi,

For Part 1), I tried your code (without the commented lines) and it worked fine : the CheckComboBox starts with item selected. Using "SelectedItemsOverride" and/or "SelectedValue " will check the 2 first entries in the CheckComboBox, which are "abc" and "def". I tried activating the selection it in the constructor of the Window and/or in the Loaded callback of the Window and it still worked. I tried this selection in Toolkit v1.9 and v2.0 with success. It has to be something else, maybe in xaml ?

For Part 2) I reproduce the bug. You are doing a For loop on SelectedItemsTotal. When adding, it will work. When you select an item from CheckComboBox, SelectedItemsTotal will go from 0 to 1 and the read and addition will be done to CheckListBox. When selecting a 2nd item from CheckComboBox, SelectedItemsTotal will go from 1 to 2 and the read and addition will be done on the 2nd loop to CheckListBox.

But when removing an item from CheckComboBox, if you have 2 selectedItems ("abc" and "def") and you remove "def", CheckComboBox.SelectedItems will contain "abc". But your "selectedCostCenter[ j ]" will contain "abc" while "e.Item" will contain "def" (the removedItem). Since it's not equal, no removing will be done in CheckListBox.

You should find another way of detecting the removedItem. I confirm that the line :
 _checkListBox.Items.Remove( stRead.ReadLine() );
works to remove data from CheckListBox.

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>