When I have a simple DataSet that has a table with simple column names (i.e. no spaces or periods), code like the following works just fine:
DataGrid resultsGrid=...;
In the above example, the DataGrid has the AutoGenerateColumns attribute set to True and correctly fills its data from the table in the DataSet .
However, if there are columns in my table with names containing spaces / periods or other special characters, auto-linking seems to fail. I get errors like:
System.Windows.Data Information: 20: BindingExpression cannot retrieve a value due to missing information. BindingExpression: Path = My Col. Name; DataItem = 'DataRowView' (HashCode = 8146871); target element "TextBlock" (Name = ''); target is "Text" (type "String")
Obviously, the automatically generated binding expression Path=My Col. Name Path=My Col. Name not valid. The entire path must be "cited" to allow spaces and periods. Is there a way to stick with AutoGeneratedColumns for tables with more complex column names, or do I need all the manual guidance now?
source share