skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class RadOpenFileDialog

Represents a Telerik-themed open file dialog control that allows users to browse and select files from the file system. This control provides advanced functionality including multi-file selection, filtering, and custom theming while maintaining compatibility with standard Windows file dialogs.

Inheritance
System.Object
FileDialogComponentBase
RadOpenFileDialog
Inherited Members
FileDialogComponentBase.ShowDialog()
FileDialogComponentBase.ShowDialog(IWin32Window)
FileDialogComponentBase.OpenFileInternal(FileMode, FileAccess)
FileDialogComponentBase.DialogForm
FileDialogComponentBase.FileName
FileDialogComponentBase.ShowNetworkLocations
FileDialogComponentBase.InitialDirectory
FileDialogComponentBase.RestoreDirectory
FileDialogComponentBase.CustomPlaces
FileDialogComponentBase.ExpandToCurrentDirectory
FileDialogComponentBase.ShowHiddenFiles
FileDialogComponentBase.InitialSelectedLayout
FileDialogComponentBase.DirectoryRequesting
FileDialogComponentBase.DirectoryNavigating
FileDialogComponentBase.ShellContextMenuOpening
FileDialogComponentBase.ExceptionRaised
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll

Syntax

public class RadOpenFileDialog : FileDialogComponentBase, IMultiSelectable, IMultiFilesSelectable, IFileExtensionFilterable

Constructors

RadOpenFileDialog()

Initializes a new instance of the RadOpenFileDialog class. Creates the underlying dialog form and prepares the control for use.

Declaration
public RadOpenFileDialog()

Properties

DefaultExt

Gets or sets the default file extension that will be appended to file names when no extension is specified. The extension should include the leading period (e.g., ".txt"). If set to null or empty, no default extension is applied.

Declaration
public string DefaultExt { get; set; }
Property Value
System.String

Implements
IFileExtensionFilterable.DefaultExt

DereferenceLinks

Gets or sets a value indicating whether the dialog resolves shortcut links to their target files. When true, selecting a shortcut (.lnk) file returns the path to the target file. When false, selecting a shortcut returns the path to the shortcut file itself.

Declaration
public bool DereferenceLinks { get; set; }
Property Value
System.Boolean

EditingOptions

Gets or sets the editing options that determine how files and folders in the ExplorerControl can be modified. This property controls user operations such as renaming, deleting, and creating new items within the dialog. Note that shell context menu and drag-and-drop operations are handled separately from these settings.

Declaration
public EditingOptions EditingOptions { get; set; }
Property Value
EditingOptions

FileNames

Gets a collection of full file paths for all files selected by the user. When MultiSelect is false, this collection contains at most one item. When MultiSelect is true, this collection contains all selected file paths.

Declaration
public IEnumerable<string> FileNames { get; }
Property Value
System.Collections.Generic.IEnumerable<System.String>

Implements
IMultiFilesSelectable.FileNames

Filter

Gets or sets the file name filter string that determines which files are displayed in the dialog. The filter string contains filter pairs separated by the pipe character, where each pair consists of a description and pattern. For example: "Text files (.txt)|.txt|All files (.)|."

Declaration
public string Filter { get; set; }
Property Value
System.String

Implements
IFileExtensionFilterable.Filter

FilterIndex

Gets or sets the index of the currently selected filter in the file type drop-down list. The index is one-based, where 1 corresponds to the first filter in the Filter string. Setting this to 0 or an invalid index will select the first available filter.

Declaration
public int FilterIndex { get; set; }
Property Value
System.Int32

Implements
IFileExtensionFilterable.FilterIndex

MultiSelect

Gets or sets a value indicating whether multiple files can be selected simultaneously in the dialog. When enabled, users can select multiple files using Ctrl+click or Shift+click, and the selected files can be accessed through FileNames.

Declaration
public bool MultiSelect { get; set; }
Property Value
System.Boolean

Implements
IMultiSelectable.MultiSelect

OpenFileDialogForm

Gets the underlying RadOpenFileDialogForm that provides the user interface and core functionality for the open file dialog. This property provides access to form-specific properties and methods that are not exposed at the component level.

Declaration
public RadOpenFileDialogForm OpenFileDialogForm { get; }
Property Value
RadOpenFileDialogForm

OpenFileDialogViewModel

Gets the view model that manages the data and business logic for the open file dialog. The view model provides access to the underlying data structure and state management for the dialog.

Declaration
public OpenFileDialogViewModel OpenFileDialogViewModel { get; }
Property Value
OpenFileDialogViewModel

ReadOnlyChecked

Gets or sets a value indicating whether the read-only checkbox in the dialog is currently checked. When checked, this typically indicates that the selected file should be opened in read-only mode. This property only has an effect when ShowReadOnly is set to true.

Declaration
public bool ReadOnlyChecked { get; set; }
Property Value
System.Boolean

SafeFileNames

Gets a collection of file names (without path information) for all files selected by the user. This property provides only the file names and extensions, excluding the directory path. The collection corresponds to the files in FileNames but contains only the file names.

Declaration
public IEnumerable<string> SafeFileNames { get; }
Property Value
System.Collections.Generic.IEnumerable<System.String>

Implements
IMultiFilesSelectable.SafeFileNames

ShowReadOnly

Gets or sets a value indicating whether the dialog displays a read-only checkbox. When enabled, users can indicate their intention to open the selected file in read-only mode. The state of this checkbox can be accessed through the ReadOnlyChecked property.

Declaration
public bool ShowReadOnly { get; set; }
Property Value
System.Boolean

Methods

CreateFileDialogForm()

Creates and returns a new instance of the dialog form that provides the user interface for the open file dialog. This method is called during initialization to create the underlying form that handles user interaction.

Declaration
protected override FileDialogFormBase CreateFileDialogForm()
Returns
FileDialogFormBase

A new RadOpenFileDialogForm instance that serves as the dialog's user interface.

Overrides
FileDialogComponentBase.CreateFileDialogForm()

OpenFile()

Opens a read-only stream for the file selected by the user in the dialog. This method provides convenient access to the selected file's content without requiring manual stream creation. The returned stream should be disposed of properly after use.

Declaration
[SecurityCritical]
public Stream OpenFile()
Returns
System.IO.Stream

A new System.IO.Stream that provides read-only access to the selected file's content.

Exceptions
System.ArgumentNullException

Selected file is null.

System.ArgumentException

Selected file is empty string, contains only white space, contains one or more invalid characters, or refers to a non-file device.

System.NotSupportedException

Selected file refers to a non-file device.

System.IO.FileNotFoundException

Selected file cannot be found, such as when mode is FileMode.Truncate or FileMode.Open, and the file specified by path does not exist. The file must already exist in these modes.

System.IO.IOException

An I/O error occurred or the stream has been closed.

System.Security.SecurityException

The caller does not have the required permission.

System.IO.DirectoryNotFoundException

Selected file is invalid, such as being on an unmapped drive.

System.UnauthorizedAccessException

The access requested is not permitted by the operating system for the specified path, such as when access is Write or ReadWrite and the file or directory is set for read-only access.

System.IO.PathTooLongException

The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.

System.ArgumentOutOfRangeException

The specified mode contains an invalid value.

Explicit Interface Implementations

IMultiSelectable.SelectedFileSystemInfoWrappers

This property is not relevant for this class.

Declaration
ObservableCollection<FileSystemInfoWrapper> IMultiSelectable.SelectedFileSystemInfoWrappers { get; }
Returns
System.Collections.ObjectModel.ObservableCollection<FileSystemInfoWrapper>

Implements
IMultiSelectable.SelectedFileSystemInfoWrappers

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.