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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:19:02+00:00 2026-05-15T06:19:02+00:00

Funny, how sometimes the simple things bite me in the behind. I can bind

  • 0

Funny, how sometimes the simple things bite me in the behind.

I can bind a DataGrid nicely to a Collection of some arbitrary class, using a DataGridTextColumn like this:

// bound to List<Class>
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>

Now I want to bind a DataGrid to a simple Collection of String. So since there is no property “Name” or something like that to bind to, how do I write the binding:

// bound to List<String>
<DataGridTextColumn Header="Name" Binding="{Binding ???}"/>

String has no Property “Value” or something like that. And if I just write {Binding } I’ll end up with a one-way-binding, unable to write changes back to the Collection.

Thinking about it, I think it is not possible to bind to a collection, so I do need to wrap my string into a class?
Or is there a way?

  • 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-15T06:19:03+00:00Added an answer on May 15, 2026 at 6:19 am

    You can make it run with the following Binding:

    Binding="{Binding Path=.}
    

    But it wont solve your problem, because strings are reference typed that are immutable, meaning you cannot change the string reference you have bound to your user interface.

    So your thoughts are correct, you will need to wrap these strings in objects, use the path property of Binding and feed these objects to your DataGrid.

    public class StringWrapper
    {
        public string Value { get; set; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 494k
  • Answers 494k
  • 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 Take a look at this answer here. It provides all… May 16, 2026 at 10:56 am
  • Editorial Team
    Editorial Team added an answer ... setUp() apparently is never called as it should, even… May 16, 2026 at 10:56 am
  • Editorial Team
    Editorial Team added an answer Save the image to C:\xampp\htdocs\picture\randomimagename and then every once in… May 16, 2026 at 10:56 am

Trending Tags

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

Top Members

Related Questions

I'm helping a friend do a little jquery, and along with that is some
My situation: I have several components, which sometimes have changes to them, and are
I'm having some thoughts about proper building my app and provide a good and
Possible Duplicate: how to disable javascript errors on “twebbrowser” ? I'm using the TWebBrowser
OK, I have an Apple-themed nav bar, and for some reason there is some
I was wondering whether there're recommendable sites, that host collections of good and useful
Hi I have the following query running a function to get the Standard Deviation
I was in need of a way to compress images in .net so i
I'm on a project doing an iPhone application. We had a Cocoa consultant come
everyday I encounter a very strange phenomenon. From my university internet connection, sshing to

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.