wpf中DataGrid 隐藏某一行的方法:
<DataGrid Grid.Row="1" x:Name="dataGridTable" IsReadOnly="True" AlternationCount="2" AutoGenerateColumns="False" SelectionMode="Extended" HorizontalAlignment="Left" VerticalAlignment="Top" >
<DataGrid.ItemContainerStyle>
<Style TargetType="DataGridRow">
<Setter Property="Visibility" Value="{Binding Visible}"/>
</Style>
</DataGrid.ItemContainerStyle>
后台
//rows 为 ObservableCollection<ExpandoObject>
dynamic selected = rows.First(r => ((dynamic)r).GUID == guid);
selected.Visible=Visibility.Collapsed;