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

  • Home
  • SEARCH
  • 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 7617105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:03:55+00:00 2026-05-31T03:03:55+00:00

I have a following XAML: <ComboBox Name=groupComboBox ItemsSource={Binding Path=MyServiceMap.Groups} DisplayMemberPath={Binding Name}/> In the code

  • 0

I have a following XAML:

<ComboBox 
 Name="groupComboBox" 
 ItemsSource="{Binding Path=MyServiceMap.Groups}"
 DisplayMemberPath="{Binding Name}"/>

In the code behind i set this.DataContext to my viewModel.

private ServiceMap _serviceMap;
    public ServiceMap MyServiceMap
    {
        get
        {
            return _serviceMap;
        }
        set
        {
            _serviceMap = value;
            OnPropertyChanged("MyServiceMap");
        }
    }

My ServiceMap class is

public class ServiceMap
{
    //other code
    public List<Group> Groups = new List<Group>();
}

and finally:

public class Group
{
    public string Name { get; set; }
}

Unfortunately, this is not working. How can i bind combobox to show Group Name?

  • 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-31T03:03:57+00:00Added an answer on May 31, 2026 at 3:03 am

    There are two problems with your code. First is bindings are only work on properties, so the binding couldn’t find the Group field. Change it to a property.

    public class ServiceMap
    {
        public List<Group> Groups { get; set; }
    }
    

    The second one is that the DisplayMemberPath waits for a string not a binding. Change it simply to “Name”.

    <ComboBox Name="groupComboBox"
        ItemsSource="{Binding Path=MyServiceMap.Groups}"
        DisplayMemberPath="Name" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following XAML... <ComboBox x:Name=advisoriesComboBox DisplayMemberPath=Name ItemsSource={Binding Path=Advisories} SelectedItem={Binding Path=SelectedAdvisory} /> <Button Command={Binding
Consider the following XAML: <ComboBox Name=CompanyComboBox HorizontalAlignment=Stretch ItemsSource={Binding Path=GlobalData.Companies} SelectedValuePath=Id SelectedValue={Binding Customer.CompanyId, ValidatesOnDataErrors=True} DisplayMemberPath=Name
I have a ComboBox whose xaml is as follows <ComboBox Name=ComboBoxDiscussionType IsEnabled={Binding ElementName=ComboBoxDiscussionType, Path=Items.Count,
I have the following xaml, <RichTextBox Name=RichTextBoxPostContent Margin=0 Padding=8,8,8,0 IsReadOnly=True Foreground={x:Null} Xaml={Binding Path=PostContent}/> and
I have the following XAML code: <ListBox ItemsSource={Binding Languages}> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <Image Source={Binding
I have the current Combo Box XAML: <ComboBox Height=23 HorizontalAlignment=Left ItemsSource={Binding ElementName=showDomainDataSource, Path=Data} Margin=583,8,0,0
Hi I have following XAML code which is the output from XamlWriter.Save(): <StackPanel Name=itemStack
I have the following XAML: <TextBlock Text={Binding ElementName=EditListBox, Path=SelectedItems.Count} Margin=0,0,5,0/> <TextBlock Text=items selected> <TextBlock.Style>
I have the following fragment of XAML: <ComboBox Name=comboBox1 IsEditable=True Text=test TextBlock.TextAlignment=Right /> How
I have the following XAML markup in a WPF DataGrid: <DataGrid ItemsSource={Binding ResultList} Grid.ColumnSpan=4

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.