Back to Devexpress

DataViewBase.SearchControl Property

wpf-devexpress-dot-xpf-dot-grid-dot-dataviewbase-00c6794f.md

latest2.7 KB
Original Source

DataViewBase.SearchControl Property

Gets the search control. This is a dependency property.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
[Browsable(false)]
public SearchControl SearchControl { get; set; }
vb
<Browsable(False)>
Public Property SearchControl As SearchControl

Property Value

TypeDescription
SearchControl

The search control for the GridControl or TreeListControl.

|

Remarks

The SearchControl property returns the GridControl‘s search control and allows you to obtain or specify its properties.

If you use a standalone search control associated with a grid, set DataViewBase properties (ShowSearchPanelFindButton, SearchPanelFindMode, etc.) to configure the search control.

Example

This example shows how to set a custom search control instead of the built-in Search Panel.

xaml
<Window x:Class="DXGrid_Custom_SearchControl.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        Title="MainWindow" Height="420" Width="550">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <dxg:GridSearchControl View="{Binding ElementName=view}"/>

        <dxg:GridControl Grid.Row="1" AutoGenerateColumns="AddNew">
            <dxg:GridControl.View>
                <dxg:TableView x:Name="view" ShowSearchPanelMode="Never"/>
            </dxg:GridControl.View>
        </dxg:GridControl>
    </Grid>
</Window>

See Also

DataViewBase Class

DataViewBase Members

DevExpress.Xpf.Grid Namespace