WPF DataGrid Binding Code Behind Problem
WPF
1
Posts
1
Posters
1
Views
1
Watching
-
I have a list of objects:
List packs;
Each pack entity has a Caption property and an int Days property on it. I'm trying to bind a data grid in code begind:
dataGrid.Columns.Add(new DataGridTextColumn
{
Header = pack.Caption,
Binding = new Binding("Days")
});This won't compile with "Cannot create an instance of the abstract class or interface 'Binding'" Every example I find shows it done this way. What's wring here???
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.