I cannot bind the Visible property of the WPF datagridtextcolumn to a boolean value.
My binding expression is,
{Binding Path=DataContext.IsThisColumnVisible, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window},Converter={StaticResource vc}}
I have checked that the converter works (bool to the visibility enum) and is in scope.
If I use the same expression for the header of the column, the header displays 'false' as expected.
Visible is a dependency property so should be bindable.
Anyone see what Im doing wrong? Or has anyone else been able to bind to the visible property.
Regards,
Matt
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…