Xceed DataGrid for WPF v7.2 Documentation
Showing or hiding the SearchControl

The following example shows how to use a button to show or hide the SearchControl.

XAML
Copy Code
<Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
  <Grid.Resources>
    <xcdg:DataGridCollectionViewSource x:Key="cvs_orders"
                                    Source="{Binding Source={x:Static Application.Current}, Path=Orders}">     
  </Grid.Resources>
  <Grid.RowDefinitions>
    <RowDefinition  Height="Auto" />
    <RowDefinition />
  </Grid.RowDefinitions>
  <Button Content="Toggle search control"
          Command="xcdg:DataGridCommands.ToggleSearch"
          CommandTarget="{Binding ElementName=OrdersGrid}" />
  <xcdg:DataGridControl x:Name="OrdersGrid"
                        Grid.Row="1"
                        ItemsSource="{Binding Source={StaticResource cvs_orders}}">   
  </xcdg:DataGridControl>
</Grid>