In a loop which sets up my WPF DataGrid columns, I want to bind the column width to member 'i' in my 'WidthList' with the following code:
var bindingColumnWidth = new Binding(string.Format("WidthList[{0}]", i));
customBoundColumn.Width = bindingColumnWidth;
However, this gives me the error:
Cannot implicitly convert type 'System.Windows.Data.Binding' to 'System.Windows.Controls.DataGridLength'
How can I resolve this?