I'm using DataGrid control and I need to hide it. I've tried to use dtgAllAccounts.Visibility =开发者_Python百科 Visibility.Collapsed. But this doesn't work. Column headers still visible. Are there any ways to hide entire DataGrid with all column headers?
<sdk:DataGrid AutoGenerateColumns="False" HorizontalAlignment="Center" Name="dtgAllAccounts" VerticalAlignment="Center" SelectionMode="Single">
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn Binding="{Binding FriendlyName}" Header="Friendly Name" IsReadOnly="True"></sdk:DataGridTextColumn>
<sdk:DataGridTextColumn Binding="{Binding Email}" Header="Email" IsReadOnly="True"></sdk:DataGridTextColumn>
</sdk:DataGrid.Columns>
</sdk:DataGrid>
Wrap it in a Grid
and hide that.
精彩评论