New to Telerik UI for WPF? Download free 30-day trial


The RadFilePathPicker control exposes an IconTemplateSelector, which allows you to easily change the displayed icon depending on the FilePath.


The default value of the IconTemplateSelector property of the control is an instance of FilePathPickerIconTemplateSelector. It exposes the following properties:

  • EmptyTemplate

    The EmptyTemplate is displayed, when the FilePath property of the control is null or empty as demonstrated in Figure 1.

    Figure 1: FilePathPickerIconTemplateSelector EmptyTemplate

    FilePathPickerIconTemplateSelector EmptyTemplate

  • NonEmptyTemplate

    The NonEmptyTemplate is displayed, when the FilePath property of the control is not empty as demonstrated in Figure 2.

    Figure 2: FilePathPickerIconTemplateSelector NonEmptyTemplate

    FilePathPickerIconTemplateSelector NonEmptyTemplate

In order to hide the icon, you can set the IconVisibility property of the control to Collapsed.

Custom FilePathPickerIconTemplateSelector

Example 1 demonstrates how to create a custom FilePathPickerIconTemplateSelector and display red/green Rectangle elements depending on whether the FilePath is empty.

Example 1: Custom FilePathPickerIconTemplateSelector

        <DataTemplate x:Key="MyEmptyTemplate"> 
            <Rectangle Fill="Red" /> 
        <DataTemplate x:Key="MyNonEmptyTemplate"> 
            <Rectangle Fill="Green" /> 
        <telerik:FilePathPickerIconTemplateSelector x:Key="MyItemTemplateSelector" EmptyTemplate="{StaticResource MyEmptyTemplate}" NonEmptyTemplate="{StaticResource MyNonEmptyTemplate}" /> 
    <telerik:RadFilePathPicker IconTemplateSelector="{StaticResource MyItemTemplateSelector}" /> 

Figure 3: Custom FilePathPickerIconTemplateSelector EmptyTemplate

Custom FilePathPickerIconTemplateSelector EmptyTemplate

Figure 4: Custom FilePathPickerIconTemplateSelector NonEmptyTemplate

Custom FilePathPickerIconTemplateSelector NonEmptyTemplate

See Also

In this article