Unable to display data in a WPF datagrid that has a DataView instance as the items source

天大地大妈咪最大 提交于 2019-12-02 00:54:28

It turns out that for my second and third columns, I have been using perverse column names. I ultimately wanted my DataTable to be dynamic in that it could have a variable number of columns, and I wanted to uniquely identify each column by date. So, I appended two strings, one with a name and one with numbers delimited by "/". It seems that this caused some binding problems with a DataGrid object.

In order to solve this problem, I changed the string uniquely identifying the date with a number for the day in the year and the year. As a result, I was able to display the data.

It is interesting to note that there are no such problems when using slashes in DataTable column names when binding to GridViews in ASP.NET.

In fact the column Binding name is case sensitive and must match the underlying dataview column names exactly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!