views:

11

answers:

1

Hello! I'm using DataGrid control and I need to hide it. I've tried to use dtgAllAccounts.Visibility = 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>
+2  A: 

Wrap it in a Grid and hide that.

Bablo