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

OpenFileDialog Filter property in EditorBrowser

7 Answers 176 Views
BrowseEditor
This is a migrated thread and some comments may be shown as answers.
Erica
Top achievements
Rank 1
Erica asked on 17 Oct 2012, 06:56 AM
When using the EditorBrowser control, is it possible to set properties on the OpenFileDialog dialog, such as the OpenFileDialog.Filter property?

7 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 17 Oct 2012, 01:45 PM
Hello Erica,

Thank you for writing.

I assume that you are asking about RadBrowseEditor. If so, yes you can access the OpenFileDialog and introduce the desired settings:
if (radBrowseEditor1.DialogType == Telerik.WinControls.UI.BrowseEditorDialogType.OpenFileDialog)
{
    OpenFileDialog dialog = (OpenFileDialog)radBrowseEditor1.Dialog;
    dialog.Filter = "(*.txt)|*.txt";
}

I hope this helps.
 
Greetings,
Stefan
the Telerik team
You’ve been asking for it and now it’s time for us to deliver. RadControls for WinForms Q3 2012 release is just around the corner. Sign up for a free webinar to see first all the latest enhancements.
0
CSharpBR
Top achievements
Rank 1
answered on 15 Jun 2018, 01:32 PM

Hi

Do we have something to do this on the graphical interface ? If not there is an example somewhere ?

Thanks

0
CSharpBR
Top achievements
Rank 1
answered on 15 Jun 2018, 01:57 PM

i used on the event click

private void radBrowseEditor1_Click(object sender, EventArgs e)

OpenFileDialog dialog = (OpenFileDialog)radBrowseEditor1.Dialog;
    dialog.Filter = "(*.txt)|*.txt";

}

0
Hristo
Telerik team
answered on 18 Jun 2018, 08:11 AM
Hello Sergio,

Thank you for updating the thread. Handling the click event is a possible solution.  Please also note that you can access the dialog at any time and change its filter.

Let me know if you need further assistance.

Regards,
Hristo
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.
0
CSharpBR
Top achievements
Rank 1
answered on 18 Jun 2018, 12:02 PM

"Please also note that you can access the dialog at any time and change its filter."

where ?

thks

0
Hristo
Telerik team
answered on 18 Jun 2018, 12:30 PM
Hi Sergio,

For example, you can set the filter in the constructor of the form: 
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
    public RadForm1()
    {
        InitializeComponent();
 
        OpenFileDialog dialog = this.radBrowseEditor1.Dialog as OpenFileDialog;
        if (dialog != null)
        {
            dialog.Filter = "(*.txt)|*.txt";
        }
    }
}

I am also attaching my test project.

Regards,
Hristo
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.
0
CSharpBR
Top achievements
Rank 1
answered on 20 Jun 2018, 06:32 PM
Thanks ! Worked fine.
Tags
BrowseEditor
Asked by
Erica
Top achievements
Rank 1
Answers by
Stefan
Telerik team
CSharpBR
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or