Hi,
I'm trying to set the Visibility of a TextColumn using binding (MVVM style, INotifyPropertyChanged...):
Visibility="{Binding ElementName=LayoutRoot, Path=DataContext.MyVisibilityProperty}"
Somehow this doesn't work. The MyVisibilityProperty raises the PropertyChanged event, but nothing happens. How can I get this to work?
Thanks,
Arjen
Hi Arjen,
I looked more thourougly into this and found a solution that should work better in your situation: Visibility={Binidng isVisible, Source={StaticResource myViewModel}
Hope this suits you better. Please let me know if you got everything working.
Regards Petar.
Hi Petar,
This was indeed the solution. Thanks.
Hi, When I followed that approach, the visibility works fine but I think the ItemsSource of my XamGrid is not binding properly because the data is not displayed
<ig:XamGrid x:Name="dataGrid" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="6" AutoGenerateColumns="False" KeyboardNavigation="AllLayouts" ItemsSource="{Binding Employees,Source={StaticResource ViewModel}}" ColumnWidth="120">
<ig:TextColumn Key="FirstName" Tag="{StaticResource ViewModel}" IsHideable="False" IsFixed="Left" >
<ig:TextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="First Name"/>
</DataTemplate>
</ig:TextColumn.HeaderTemplate>
</ig:TextColumn>
</XamGrid>
The visibility works but the data binding does not work