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 6753621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:11:00+00:00 2026-05-26T13:11:00+00:00

I am having trouble with a telerik combobox in silverlight I have defined it

  • 0

I am having trouble with a telerik combobox in silverlight

I have defined it like this,

<telerik:RadComboBox SelectedItem="{Binding Organisation, Mode=TwoWay}" ItemsSource="{Binding Organisations}" DisplayMemberPath="Name" />

And the SelectedItem property bound to looks like this,

[Required(ErrorMessage = "The organisation is required.")]
public OrganisationEntity Organisation
{
    get
    {
        return utilityOwnerOrganisation;
    }
    set
    {
        utilityOwnerOrganisation = value;
        RaisePropertyChanged(this, x => x.UtilityOwnerOrganisation);
    }
}

The OrganisationEntity is like this,

public class OrganisationEntity 
{
    public string Name { get; set; }
    public int OrganisationId { get; set; }
}

The problem arises if the list Organisations have two organisations in it defined like this,

new OrganisationEntity() { Name = "Wellington City Council", OrganisationId = 34 }
new OrganisationEntity() { Name = "Wellington City Council", OrganisationId = 31 }

If I have two items with the same Name in the list and set the Organisation property (from the viewmodel) to be the item with OrganisationId = 31 the setter is called from the binding engine and the other item gets selected.

The reason is because of DisplayMemberPath being set to Name. It is treating the Name as being a key and assuming that it is unique in the combobox, but it isn’t.

If I take out the DisplayMemberPath it works, but the combobox then displays the wrong thing.

If I take out the DisplayMemberPath and define a ToString method to return the Name property in the OrganisationEntity the same thing occurs.

  • 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-05-26T13:11:00+00:00Added an answer on May 26, 2026 at 1:11 pm

    Try to remove the DisplayMemberPath and use a DataTemplate to show what you want instead:

    <ComboBox ItemsSource="{Binding Organisations}">
        <ComboBox.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Name}"/>
            </DataTemplate>
        </ComboBox.ItemTemplate>
    </ComboBox>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having trouble inheriting from a template class. Looks something like this: template<typename type> class
I am using a Telerik MVC control (combobox) and I am having trouble getting
Having Trouble with Entity Framework. I have been populating EntityReferences with an EntityKey inorder
I`m having trouble trying to optimize this query with OVER (PARTITION BY ...) because
Having trouble getting this syntax right: SELECT DISTINCT id FROM metadata WHERE (meta_key =
Having trouble with this -- a couple of other related posts out there, but
I'm having trouble selecting the input value from this html: <li class=t-item> <div class=t-mid>
Having trouble with an sql statement to retrieve a record between two timestamps. This
Having trouble with some select statements. I have 2 tables. sms_log and sms_messages. sms_log
Having trouble geting the encoding right in my silverlight application. I need support for

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.