I have a source collection made of a lightweight datatable.
When I create manually from code behind the columns of the grid, I also bind each one of them to the DataColumn of the DataTable which has the same name.
The thing is, how come this line :
throws an exception when col.columnName = "2009" ??
When I create manually from code behind the columns of the grid, I also bind each one of them to the DataColumn of the DataTable which has the same name.
The thing is, how come this line :
GridViewDataColumn col3 = new GridViewDataColumn() { Header = col.ColumnName.ToString().Replace('_', ' '), DataType = typeof(Decimal), DataMemberBinding = new Binding() { Path = new PropertyPath(col.ColumnName)}, CellStyle = this.Resources["gridviewCellStyle"] as Style, UniqueName = col.ColumnName, TextAlignment = TextAlignment.Right, IsVisible = col.IsVisible }; |
throws an exception when col.columnName = "2009" ??