Telerik Forums
UI for WPF Forum
0 answers
27 views

I'm making a simple file upload application that should only accept Excel files.
I've found out how I need to set the filter on the RadOpenFileDialog and I'm throwing an error (via messagebox) when the extension is wrong when dropping a file on the control.

        public RelayCommand FilePathChangedCommand => new RelayCommand((ea) =>
        {
            if (!string.IsNullOrEmpty(FilePath))
            {
                var extension = Path.GetExtension(FilePath);
                if (!extension.In("xls", "xlsx", "xlsm"))
                {
                    //throw error
                }
                else
                {
                    //process file
                }
            }
        });

When the extension is wrong, I would also like to clear the value in the RadFilePathPicker. But when I make it empty in the FilePathChanged event, it doesn't do anything.

What would be the correct approach to clear the control in this case?

Ict
Top achievements
Rank 1
Iron
 updated question on 27 Oct 2023
1 answer
43 views
I'm using a RadFilePathPicker to select a file. This gives a choice of dialogs to use via the DialogType property. Each of these dialog types have the LoadDrivesInBackground property but this is not available at the RadFilePathPicker level. Is it possible and if so how can I set this property at the RadFilePathPicker control level so that whichever dialog I use has this property set? 
Petar Mladenov
Telerik team
 answered on 16 Aug 2023
0 answers
113 views

Codebase  available here : https://github.com/CrownParkComputing/MegaDownloaderFinal

so using the FolderDialog example for wpf, The binding for the propertt FolderName does not update after selecting a new folder. The original assignment works fine?

Errors shown  :

FolderName property not found on object of type String.

IsSearchActive property not found on object of type OpenFolderDialogViewModel.

ItemTemplate and ItemTemplateSelector are ignored for items already of the ItemsControl's container type RadWatermarkTextBox

Please help with these issues I am stumped. 

 

Jonathan
Top achievements
Rank 1
Iron
 asked on 26 Apr 2022
1 answer
62 views

Hi,

I haven't used .Net in a while, I've lost some basic knowledge.

Can someone show me how to fix this underline error? 

I am using vb.net.

Please let me know if you need more details. 

 

Thank you!

Khanh
Top achievements
Rank 1
Iron
 answered on 23 Sep 2021
2 answers
233 views

I have a FilePathPicker with the FilePath property set to a two-way binding to a view-model property.  Whenever (in code-behind) I  set the corresponding bound property (and then Raise a PropertyChanged notification for it), the FilePath in the text box does not update, no matter what the UpdateSourceTrigger.  I cannot understand why.

I went and wrote a test application and reproduced the same effect.  Isn't the FilePath property supposed to work as a two-way binding?

Here is the XAML binding.

<tk:RadFilePathPicker FilePath="{Binding ReportHeaderImagePath, Mode=TwoWay}" IconVisibility="Collapsed"/>

 

 

And here is the bound property in the ViewModel

 

private string _reportHeaderImagePath;
 
public string ReportHeaderImagePath
{
    get => Settings.ReportHeaderImagePath;
    set
    {
        _reportHeaderImagePath = value;
        RaisePropertyChanged(nameof(ReportHeaderImagePath));
    }
}


When my code sets this ReportHeaderImagePath property to null or string.Empty, I can see the value being set in the debugger and I can see the PropertyChanged event being raised.   But still the editor in the RadFilePathPicker does not change.  The previous path stays there.   I have to either manually edit it or click the little "X" button inside it.

I have tried setting the Binding's UpdateSourceTrigger value all possible choices Default, LostFocus, PropertyChanged and even Explicit.  Nothing works.  

What am I missing?

 

Joe
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 09 Mar 2021
5 answers
221 views

We are using the RadFilePathPicker and we can set the theme of the picker control but how do we set the theme of the resulting dialog when the control is opened?  The theme does not seem to carry over.

 

<telerik:RadFilePathPicker DialogType="SaveFile" FilePath="{Binding SaveLocation, Mode=TwoWay}" Margin="0" 
                                               WatermarkContent="No File Selected" VerticalAlignment="Center" Height="30" Grid.Row="4" Grid.Column="1"
                                               telerik:StyleManager.Theme="Office2016Touch"/>          

 

Dinko | Tech Support Engineer
Telerik team
 answered on 14 Oct 2020
1 answer
187 views

Hi,

I have a FilePathPicker with DialogType="OpenFile".  Is there a way to set a default directory so that wen a user wants to pick a file, the FilePathPicker opens the the dialog with the files in this directory ?

Regards,
Hans

 
Martin Ivanov
Telerik team
 answered on 09 Sep 2020
1 answer
189 views

Is it possible to set a Filter for the OpenFileFialog, when you browse for a file?

 

Example *.pdf

Petar Mladenov
Telerik team
 answered on 07 May 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?