Binding on DataGridTemplateColumn Properties don't work

Jun 25, 2009 at 5:48 PM

Hello,

I'm trying to bind two properties of the DataGridTemplateColumn - the "Header" property and the "Visibility" property, to two properties on my window class which
created the data grid. In both cases, the binding don't work. I checked the same binding with the "Visibility" property of another control, and it worked perfectly.

the binding of the visibility property looks like this:

<dg:DataGridTemplateColumn Header="Color" Width="70" Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:ObjectsCheckListControl}}, Path=IsColorColumnVisible, Mode=OneWay, Converter={StaticResource Bool2VisibilityConverter}}">

whereas ObjectsCheckListControl is my custom user control and is my x:Class of the current xaml file.



I don't have a clue what seem to be the problem..
Does anyone once tried to bind these properties on the DataGridTemplateColumn and succeeded?
Or have Any suggestions?

Thanks,
Avner.Ho.