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

New Post: Store checked items from CheckComboBox in a string array

$
0
0
in a ItemsSelectionChanged event, I wish to store those checked items in a string array, is that possible?
I try below:

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();
        }
     }
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.

Viewing all articles
Browse latest Browse all 4964

Trending Articles



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