Skip to main content
All docs
V26.1
  • GridDataViewBase.SearchPanelRightContentTemplate Property

    Gets or sets the template designed to display additional UI elements to the right of the Search Panel. This is a dependency property.

    Namespace: DevExpress.Xpf.Grid

    Assembly: DevExpress.Xpf.Grid.v26.1.Core.dll

    Declaration

    public DataTemplate SearchPanelRightContentTemplate { get; set; }

    Property Value

    Type Default Description
    DataTemplate null

    A DataTemplate that displays additional UI elements to the right of the Search Panel.

    Remarks

    The SearchPanelRightContentTemplate property allows you to complement the Search Panel with custom UI elements (for example, display a label, icon, or button to the right).

    Tip

    The template’s DataContext returns the current view, so you can bind template elements directly to view properties.

    Example: Display the Clear Button for the Search Panel

    The following example adds the Clear button to the right of the Search Panel:

    Search Panel Right Content

    <dx:ThemedWindow x:Class="GroupPanelExample.MainWindow"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
                     xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
                     ... >
        <Window.Resources>
            <DataTemplate x:Key="SearchPanelRightTemplate">
                <Button Content="Clear" Command="{Binding ClearSearchCommand}" VerticalAlignment="Center" Margin="4,0,4,0"/>
            </DataTemplate>
        </Window.Resources>
    
        <dxg:GridControl ItemsSource="{Binding Items}">
            <dxg:GridControl.View>
                <dxg:TableView
                        ShowSearchPanelMode="Always"
                        SearchPanelRightContentTemplate="{StaticResource SearchPanelRightTemplate}"/>
            </dxg:GridControl.View>
        </dxg:GridControl>
    </dx:ThemedWindow>
    
    See Also