Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Store checked items from CheckComboBox in a string array

$
0
0

From the Extended WPF Toolkit, we have the CheckComboBox.
in a ItemsSelectionChanged event, I wish to store those checked items in a string array, is that possible?
I try below:

it does not work according to my needs:
say "abc" and "def" items were checked.
it gives me selectedCostCenter[0]=abc,def
what I need is:
selectedCostCenter[0]=abc
selectedCostCenter[1]=def

how do I modify the code for my needs?
thanks.

 private void CheckComboBox_CostCenter_ItemSelectionChanged(object sender, Xceed.Wpf.Toolkit.Primitives.ItemSelectionChangedEventArgs e)
        {
            int SelectedItemsTotal = CheckComboBox_CostCenter.SelectedItems.Count;
            string[] selectedCostCenter = new string[SelectedItemsTotal];
            for (i = 0; i < SelectedItemsTotal; i++)
            {
                selectedCostCenter[i] = CheckComboBox_CostCenter.SelectedValue.ToString();
            }
         }


Viewing all articles
Browse latest Browse all 31927

Latest Images

Trending Articles



Latest Images

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