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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:30:58+00:00 2026-05-11T19:30:58+00:00

I have objects I’m databinding to a ListBox in WPF. Here’s what the end

  • 0

I have objects I’m databinding to a ListBox in WPF. Here’s what the end result should look like:

-------------------------------
| Name    | Opt1    |  Value1 |
|         | Opt2    |  Value2 |
|         | Opt3    |  Value3 |
|         | Opt4    |  Value4 |
-------------------------------

Essentially i’ve got a DataTemplate for the overall variable, and then the Opt/Value combo has it’s own DataTemplate. I’m trying to display the list of values as simply as possible.

<Label Content="{Binding Path=Identifier.Name, Mode=OneWay}" />
<ListView Grid.Column="1" HorizontalAlignment="Stretch" 
          ItemsSource="{Binding Path=Values, Mode=OneWay}" />

The binding for Values is currently only a <Grid> with 2 <Label>‘s and ListView has a lot of features I dont watch, such as the border styling, selections, and such, when all I really want is to be able to databind using a List.

I’ve tried to databind the items to a stackpanel but couldn’t get it to work in XAML. I suppose another solution is to do what I’m doing, and rewrite the <Style> for ListView. Any suggestions on the correct way to do this?

  • 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-11T19:30:58+00:00Added an answer on May 11, 2026 at 7:30 pm

    It certainly sounds like something you can do with a ListBox, or an ItemsControl if you do not want them to be selectable. We can also make use of the IsSharedSizeScope attached property to keep our columns formatted and even. Also, take a look at the Inheritance Higharchy at the bottom of the ListBox link, it should help you determine which type of list you need for different scenarios.

    Try something like this:

    <DockPanel>
      <Label Content="{Binding Path=Identifier.Name, Mode=OneWay}" />
      <ListBox ItemsSource="{Binding Path=Values, Mode=OneWay}"
               Grid.IsSharedSizeScope="True">
        <ListBox.ItemTemplate>
          <DataTemplate>
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition SharedSizeGroup="OptionColumn" />
                <ColumnDefinition SharedSizeGroup="ValueColumn" />
              </Grid.ColumnDefinitions>
              <TextBlock Grid.Column="0" Text="{Binding Option}" />
              <TextBlock Grid.Column="1" Text="{Binding Value}" />
            </Grid>
          </DataTemplate>
        </ListBox.ItemTemplate>
      </ListBox>
    </DockPanel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 136k
  • Answers 136k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer IIS 7 Has a managed code API which should allow… May 12, 2026 at 7:14 am
  • Editorial Team
    Editorial Team added an answer This (if you want to check that the user exists)… May 12, 2026 at 7:14 am
  • Editorial Team
    Editorial Team added an answer It depends on the Type of authentication you have, where… May 12, 2026 at 7:14 am

Related Questions

I am currently running into a problem where an element is coming back from
I have objects I'm databinding to a ListBox in WPF. Here's what the end
I have 2 objects to create that are identical except for that they refer
I have objects representing folders and I'm wondering if they should be represented in
I have some model objects I'm using in my Java client application. Later these

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.