0
我正在使用DataGrid控件,我需要隱藏它。我試過使用dtgAllAccounts.Visibility = Visibility.Collapsed。但這不起作用。列標題仍然可見。有沒有什麼方法可以隱藏所有列標題的整個DataGrid?如何在Silverlight中隱藏整個DataGrid?
<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>