New to Telerik UI for WPFStart a free 30-day trial

Commands

Updated on Sep 15, 2025

The RadFilePathPicker control provides the following commands through the RadFilePathPickerCommands static class: ShowDialog and Clear.

ShowDialog command

The ShowDialog command can be set to the Command property of another element such as a Button or it can be executed in code. Both approaches are demonstrated in Examples 1 and 2. When executed, it opens a different file dialog depending on the DialogType.

Example 1: Binding the ShowDialog command the Command property of a Button

XAML
    <StackPanel xmlns:fileDialogs="clr-namespace:Telerik.Windows.Controls.FileDialogs;assembly=Telerik.Windows.Controls.FileDialogs">

        <telerik:RadFilePathPicker x:Name="filePathPicker" />

        <Button Content="Show Dialog" Command="{x:Static fileDialogs:RadFilePathPickerCommands.ShowDialog}" CommandTarget="{Binding ElementName=filePathPicker}" />
    </StackPanel>

Example 2: Executing the ShowDialog command in code

C#
    RadFilePathPickerCommands.ShowDialog.Execute(null, this.filePathPicker);

Clear command

The Clear command can be set to the Command property of another element such as a Button or it can be executed in code. Both approaches are demonstrated in Examples 3 and 4. When executed, it clears the Text of the control.

Example 3: Binding the Clear command the Command property of a Button

XAML
    <StackPanel xmlns:fileDialogs="clr-namespace:Telerik.Windows.Controls.FileDialogs;assembly=Telerik.Windows.Controls.FileDialogs">
       
        <telerik:RadFilePathPicker x:Name="filePathPicker" />

        <Button Content="Clear" Command="{x:Static fileDialogs:RadFilePathPickerCommands.Clear}" CommandTarget="{Binding ElementName=filePathPicker}" />
    </StackPanel>

Example 4: Executing the Clear command in code

C#
    RadFilePathPickerCommands.Clear.Execute(null, this.filePathPicker);

See Also