Silverlight5
I am trying to get the TextBlock to be visible when there is no data in the DataGrid.
What to bind to in the DataGrid?
When I bind to Visibility as below, it always returns true even when there is no data in the grid.
<TextBlock Grid.Row="4" HorizontalAlignment="Center" Text="No User Accounts found."
Visibility="{Binding ElementName=AccountGridT32, Path=Visibility,
Converter={StaticResource NegateVisibilityConverter}}" />
<Grid Grid.Row="5">
<sdk:DataGrid x:Name="AccountGridT32"
ItemsSource="{Binding Data, ElementName=AccountsDataSourceT32}" Grid.Column="0" Grid.Row="1"
ScrollViewer.HorizontalScrollBarVisibility="Auto" />
</Grid>
What i do is bind the visibility of the texblock to the item count of the listbox/grid…
My converter: