C# lamda expression to get list of values of cehcked items

1 posts, 0 answers
  1. Aarsh
    Aarsh avatar
    192 posts
    Member since:
    Jun 2012

    Posted 26 Feb 2013 Link to this post

    At the moment I have to break down this simple operation in two parts, I am sure the would be a better way is hiding from me :

    List<int> selectedValues= new List<int>();
    IEnumerable<RadComboBoxItem> checkedItems = from checkedItem in cblMagistrateCourts.Items.ToList()
                                                                    where checkedItem.Checked == true
                                                                    select checkedItem;
                        foreach (RadComboBoxItem item in checkedItems)
                            if (item.Checked)
Back to Top