Your case is actually funny. You are binding elements of type string to a grid. The grid then looks for properties in type String that it can display. the only property found is Length, so it creates a column named Length and displays its value.
What you need to do to avoid this is create a wrapper class for string.
Either create a class explicitly:
class StringWrapper
{
string Value { get; set;}
}
or by using LINQ:
List<string> strings = new List<string>();
strings.Add("abc");
strings.Add("def");
dataGrid.ItemsSource = strings.Select(s => new { Value = s }).ToList();
Hope this helps.
testalino
2010-10-20 10:49:22