This is a migrated thread and some comments may be shown as answers.

RadBrowseEditior setting file types allowed

4 Answers 57 Views
BrowseEditor
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 03 Oct 2016, 03:03 PM

I am using the RadBrowseEditior to select image files. I have coded the object to make sure the selected file is only one of the following:

*.BMP, *.GIF, *.PNG, *.JPG

I would also like the open file dialog box to have those items set as the shown files. Is there a setting to mask the file types in the file picker?

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 04 Oct 2016, 11:45 AM
Hello Ben,

Thank you for writing.  

If the RadBrowseEditor.DialogType property is set to OpenFileDialog, it will use the OpenFileDialog for selecting a file. You can apply a filter to specify the allowed files:
this.radBrowseEditor1.DialogType = Telerik.WinControls.UI.BrowseEditorDialogType.OpenFileDialog;
OpenFileDialog dialog = (OpenFileDialog)radBrowseEditor1.Dialog;
dialog.Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif";

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Ben
Top achievements
Rank 1
answered on 07 Oct 2016, 01:46 PM
that did the trick. Thank you.
0
Raji
Top achievements
Rank 1
answered on 06 Jan 2018, 05:15 AM
how about for saving?
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 Jan 2018, 10:46 AM
Hello, Raji,  

Thank you for writing.  

For the SaveFileDialog you can refer to the following code snippet:

this.radBrowseEditor1.DialogType = Telerik.WinControls.UI.BrowseEditorDialogType.SaveFileDialog;
SaveFileDialog dialog = (SaveFileDialog)radBrowseEditor1.Dialog;
dialog.Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif";

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
BrowseEditor
Asked by
Ben
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Ben
Top achievements
Rank 1
Raji
Top achievements
Rank 1
Share this question
or