I create DataGrid Columns with Binding (where i is a Int value):
dataGrid.Columns.Add(new DataGridTextColumn
{
Header = i.ToString(),
Binding = CreateBinding(i),
});
private Binding CreateBinding(int num)
{
Binding bind = new Binding(string.Format("[{0}]", num));
bind.Converter = new CellValueConverter();
return bind;
}
In the CreateBinding method I have an access to bind.Converter property.
I need to call Converter.Convert() method in some handler, but there is no Converter property when I try to access it:
(dataGrid.Columns[clm] as DataGridTextColumn).Binding."no Converter property!"
How can I get my CellValueConverter which was created for particular Column?