Posted 25 December 2017, 12:36 am EST
I want to binding Visible in c1:Column to a boolean value but it doesn’t work because Visible isn’t DependencyProperty and c1:Column isn’t DependencyObject so i cant create attached property for it.I tried to create a celltemplate and binding all controls inside it to collapse but it only hide content of the column not the whole column. Is there any way to solve this
<c1:C1FlexGrid ItemsSource="{Binding Persons}" AutoGenerateColumns="False">
<c1:C1FlexGrid.Columns>
<c1:Column>
<c1:Column.CellTemplate>
<DataTemplate>
<TextBlock Visibility="{Binding Visible,Converter={StaticResource booleanToVisibilityConverter}}" Text="{Binding First}"/>
</DataTemplate>
</c1:Column.CellTemplate>
</c1:Column>
<c1:Column Visible="{Binding Visible}" Binding="{Binding Last}"></c1:Column>
<c1:Column Visible="True" Binding="{Binding CountryID}"></c1:Column>
<c1:Column Binding="{Binding Active}"></c1:Column>
<c1:Column Binding="{Binding Hired}"></c1:Column>
</c1:C1FlexGrid.Columns>
</c1:C1FlexGrid>