Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8013261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:35:34+00:00 2026-06-04T19:35:34+00:00

I am using a multi-selection ListPicker (the new one in the 7.1/Mango control toolkit

  • 0

I am using a multi-selection ListPicker (the new one in the 7.1/Mango control toolkit from Nov ’11).

My code is below – a “vanilla” use case for the ListPicker, except that I initialize the SelecetedItems dependency property with a new List so I can add things to it and properly initialize the selected state for the ListPicker. Although this issue repro’s whether or not I do this…

The SummaryForSelectedItemsDelegate does get called when initializing the list (e.g. when I call contactPicker.SetValue(ListPicker.SelectedItemsProperty)), but NOT when I click the “done” button on the ListPicker (although my SelectionChanged event handler does get called).

Once I dismiss the ListPicker, I only get the string corresponding to the first selected item in the “summary” for the control (as opposed to the control calling my delegate and getting a comma-delimited list of selected items).

Is this a bug? Has anyone else run into this? Is there a workaround?

var contactPicker = new ListPicker()
{
    MinWidth = minWidth,
    ExpansionMode = ExpansionMode.FullScreenOnly,
    SelectionMode = SelectionMode.Multiple,
    SummaryForSelectedItemsDelegate = (list) => { return CreateCommaDelimitedList(list); },
    IsTabStop = true
};

contactPicker.ItemsSource = listOfItems;
contactPicker.DisplayMemberPath = "Name";
contactPicker.SetValue(ListPicker.SelectedItemsProperty, new List<Item>());

// initialize the list picker selected values
foreach (var contactRef in listOfSelectedContacts)
    contactPicker.SelectedItems.Add(contactRef);

contactPicker.SelectionChanged += new SelectionChangedEventHandler((o, ea) => 
{
    // add all the newly added items
    foreach (var added in ea.AddedItems)
    {
        Item addedItem = added as Item;
        if (addedItem == null)
            continue;
        listOfSelectedContacts.Items.Add(addedItem);
    }

    // remove all the newly removed items
    foreach (var removed in ea.RemovedItems)
    {
        Item removedItem = removed as Item;
        if (removedItem == null)
            continue;
        listOfSelectedContacts.Items.Remove(removedItem);
    }
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:35:35+00:00Added an answer on June 4, 2026 at 7:35 pm

    I should have posted my my summary delegate… which is actually where my bug was 🙁

    Even though I was creating the SelectedItems as a List, and each of the elements in the IList passed in are typed “Item”, the concrete type of the IList passed in is NOT List. Therefore the null check succeeds and the method returns null. And of course my breakpoint was right after that line so it looked like the method wasn’t getting invoked. Duh.

        private string CreateCommaDelimitedList(IList ilist)
        {
            IList<Item> list = ilist as IList<Item>;
            if (list == null)
                return null;
    
            // build a comma-delimited list of names to display in a control
            List<string> names = list.Select(it => it.Name).ToList();
            StringBuilder sb = new StringBuilder();
            bool comma = false;
            foreach (var name in names)
            {
                if (comma)
                    sb.Append(", ");
                else
                    comma = true;
                sb.Append(name);
            }
            return sb.ToString();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using this: Can I use Facebook's fb:friend-selector in an iframe? I created a multi-friend
I'm new to magento. Currently i'm developing two ecommerce sites using multi-store option in
I have some models and I want to generate a multi-selection form from this
I'm using Infragistics for the first time. When I set selection mode to multi
The fbml below generates an invite form using a multi-friend-selector. Everything works, except the
I've used JQuery UI Selectable with a table, when I use multi selection with
Hopefully a simple question. I've started using NetBeans for a new multi-developer PHP project
In Vim, when I comment a multi-line visual selection using NERDCommenter, the blank lines
I can send requests to friends using Multi Friend Request Selector inside my Page
We started using Multi-Master Replication Manager for MySQL, and I am wondering whether it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.