Posted 2 September 2018, 8:09 pm EST
Hello,
I am able to see what you are mentioning. However, this and some other binding errors might be shown while C1DataGrid builds its UI. While UI is not complete yet, some bindings can’t be resolved properly. But as far as control works, you can be sure that these bindings finally got resolved. So, this is by design but would not harm your application, hence can safely ignore these warning message.
Now, to show the value of ValueAsString in cell-edit control, apart from your HotFix/workaround, I would suggest you to override PrepareCellForEdit and GetCellEditingContent methods as follows:
public DataGridRow RowEditing { get; set; }
public override object PrepareCellForEdit(FrameworkElement editingElement)
{
Binding newBinding = Binding.Clone();
newBinding.Source = RowEditing.DataItem;
editingElement.SetBinding(FrameworkElement.DataContextProperty, newBinding);
return base.PrepareCellForEdit(editingElement);
}
public override FrameworkElement GetCellEditingContent(DataGridRow row)
{
RowEditing = row;
return base.GetCellEditingContent(row);
}
Also, attached is modified application for reference.
Thanks,
Ruchir
DataGridCreateColsInCodeBehind_Fixed.zip