WPF: Bind DataGrid to List

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; }
}

Leave a Comment