RadFileExplorer
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
[RequiredScript(typeof(RadFileExplorerScripts))]
[ClientScriptResource("Telerik.Web.UI.RadFileExplorer", "Telerik.Web.UI.FileExplorer.RadFileExplorer.js")]
[TelerikToolboxCategory("Miscellaneous")]
[ToolboxBitmap(typeof(RadFileExplorer), "Toolbox.Icons.FileExplorer.png")]
[EmbeddedSkin("FileExplorer")]
[EmbeddedSkin("FileExplorer", "Default")]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadFileExplorer))]
public class RadFileExplorer : RadWebControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ICallbackEventHandler, INamingContainer, ISkinnableControl, IControl
Inheritance: objectControlWebControlRadWebControlRadFileExplorer
Implements:
Inherited Members
Constructors
public RadFileExplorer()
Properties
Specifies an access key to enable keyboard navigation for the File Explorer control
public override string AccessKey { get; set; }
Overrides:
When set to true, this property will enable paging in the File Explorer's Grid component.
[ClientControlProperty]
public bool AllowPaging { get; set; }
Gets a reference to the async upload component, which shows inside a popup window when the user wants to upload files.
[Browsable(false)]
public virtual RadAsyncUpload AsyncUpload { get; }
Determines which file list controls will be available on the client-side so that their respective file list view can be displayed dynamically
public FileListControls AvailableFileListControls { get; set; }
protected string CommandArgument { get; set; }
Contains the FileExplorer configuration (paths, content provider type, etc.).
[PersistenceMode(PersistenceMode.InnerProperty)]
public FileExplorerConfiguration Configuration { get; }
An FileManagerDialogConfiguration instance, containing the configuration of the control
protected virtual FileBrowserContentProvider ContentProvider { get; set; }
The CssClass property will now be used instead of the former Skin and will be modified in AddAttributesToRender()
protected override string CssClassFormatString { get; }
Overrides:
Returns the currently selected node in the tree. This property is useful during postbacks.
[Browsable(false)]
public string CurrentFolder { get; }
Gets or sets a value indicating whether to show the up one folder (..) item in the grid if available.
public bool DisplayUpFolderItem { get; set; }
Gets or sets a value indicating whether to allow opening a new window with the file
[Obsolete("Please use the Configuration-EnableAsyncUpload property instead")]
public bool EnableAsyncUpload { get; set; }
Gets or sets a value indicating whether to allow copying of files/folders
public bool EnableCopy { get; set; }
Gets or sets a value indicating whether to allow creating new folders
public bool EnableCreateNewFolder { get; set; }
When set to true, performs the filtering after the "Enter" key is pressed. EnableFilterTextBox should be set to true (i.e. filtering enabled) to enable filtering.
[ClientControlProperty]
[ClientPropertyName("enableFilteringOnEnter")]
public bool EnableFilteringOnEnterPressed { get; set; }
When set to true, renders a textbox used to filter files in the grid.
public bool EnableFilterTextBox { get; set; }
Gets or sets a value indicating whether to allow opening a new window with the file
[ClientControlProperty]
public bool EnableOpenFile { get; set; }
Gets or sets the current FileExplorerMode (e.g. default, show files in the tree, etc.)
public FileExplorerMode ExplorerMode { get; set; }
Gets a reference to the grid, which shows on the right of the file explorer control.
[Browsable(false)]
public FileList FileList { get; }
Gets or sets the text of the label displayed next to the Filter TextBox.
public string FilterTextBoxLabel { get; set; }
Gets a reference to the grid, which shows on the right of the file explorer control.
[Browsable(false)]
public RadGrid Grid { get; }
Gets a reference to the context menu, which shows when the user right-clicks the grid control
[Browsable(false)]
public RadContextMenu GridContextMenu { get; }
Gets or sets the height of the Web server control.
public override Unit Height { get; set; }
A System.Web.UI.WebControls.Unit that represents the height of the control. The default is System.Web.UI.WebControls.Unit.Empty.
Exceptions: ArgumentExceptionThe height of the Web server control was set to a negative value.
Overrides:
Gets or sets the initial path that will be shown in the file explorer control.
public string InitialPath { get; set; }
If this property is not set, the file explorer will use the first path in the ViewPaths as the initial one.
Gets the Keyboard Shortcuts of the FileExplorer control.
[PersistenceMode(PersistenceMode.InnerProperty)]
public FileExplorerShortcut KeyboardShortcuts { get; }
Gets or sets a string containing the localization language for the File Explorer UI
public string Language { get; set; }
Gets a reference to the grid, which shows on the right of the file explorer control.
[Browsable(false)]
public RadListView ListView { get; }
[Browsable(false)]
public DialogLocalizationStrings Localization { get; }
protected List<string> LocalizationKeys { get; }
Gets or sets a value indicating where the control will look for its .resx localization files. By default these files should be in the App_GlobalResources folder. However, if you cannot put the resource files in the default location or .resx files compilation is disabled for some reason (e.g. in a DotNetNuke environment), this property should be set to the location of the resource files.
public string LocalizationPath { get; set; }
A relative path to the dialogs location. For example: "~/controls/RadEditorResources/".
If specified, the LocalizationPath property will allow you to load the control localization files from any location in the web application.
The name of the javascript function called when the user tries to copy a file or folder.
[ClientControlEvent]
[ClientPropertyName("copy")]
public string OnClientCopy { get; set; }
The name of the javascript function called when the user tries to create a new folder.
[ClientControlEvent]
[ClientPropertyName("createNewFolder")]
public string OnClientCreateNewFolder { get; set; }
The name of the javascript function called when the user tries to delete a file.
[ClientControlEvent]
[ClientPropertyName("delete")]
public string OnClientDelete { get; set; }
The name of the javascript function called when an item is double clicked in the grid.
[ClientControlEvent]
[ClientPropertyName("fileOpen")]
public string OnClientFileOpen { get; set; }
The name of the client-side method called when the user drops files in the file list.
[ClientControlEvent]
[ClientPropertyName("filesDropping")]
public string OnClientFilesDropping { get; set; }
The name of the javascript function called when the user filters the files in the grid.
[ClientControlEvent]
[ClientPropertyName("filter")]
public string OnClientFilter { get; set; }
The name of the javascript function called when the the selected folder in the tree changes.
[ClientControlEvent]
[ClientPropertyName("folderChange")]
public string OnClientFolderChange { get; set; }
The name of the javascript function called when a folder is loaded in the grid.
[ClientControlEvent]
[ClientPropertyName("folderLoaded")]
public string OnClientFolderLoaded { get; set; }
The name of the javascript function called before the control loads in the browser.
[ClientControlEvent]
[ClientPropertyName("init")]
public string OnClientInit { get; set; }
The name of the javascript function called when the user selects an item in the explorer.
[ClientControlEvent]
[ClientPropertyName("itemSelected")]
public string OnClientItemSelected { get; set; }
The name of the javascript function called when the control loads in the browser.
[ClientControlEvent]
[ClientPropertyName("load")]
public string OnClientLoad { get; set; }
The name of the javascript function called when the user tries to rename/move a file or folder.
[ClientControlEvent]
[ClientPropertyName("move")]
public string OnClientMove { get; set; }
Gets or sets a value, indicating whether files that already exist in RadFileExplorer will be overwritten.
[ClientControlProperty]
[ClientPropertyName("overwriteExistingFiles")]
public bool OverwriteExistingFiles { get; set; }
protected char PathSeparator { get; }
Specifies the rendering mode of the control. Setting the mode to Lightweight will yield HTML 5/CSS 3 html and css.
public override RenderMode RenderMode { get; set; }
Overrides:
Implements:
Lightweight rendering mode might change the outlook of the component in some older browsers that don't support CSS3/HTML5.
Specifies the skin that will be used by the control
[TypeConverter("Telerik.Web.Design.SkinTypeConverter, Telerik.Web.Design, Version=2026.3.812.462, Culture=neutral, PublicKeyToken=121fae78165ba3d4")]
public override string Skin { get; set; }
Overrides:
Implements:
Gets a reference to the splitter component in the file explorer
[Browsable(false)]
public RadSplitter Splitter { get; }
protected override HtmlTextWriterTag TagKey { get; }
Overrides:
Gets a reference to the toolbar, which shows on the top of the file explorer control.
[Browsable(false)]
public RadToolBar ToolBar { get; }
Gets a reference to the tooltip control used for meta information popups
[Browsable(false)]
public RadToolTip TooltipControl { get; }
Gets or sets the width of the file explorer's tree pane
public Unit TreePaneWidth { get; set; }
A System.Web.UI.WebControls.Unit that represents the width of the control. The default is 222 pixels.
Exceptions: ArgumentExceptionThe width of the Web server control was set to a negative value.
Gets a reference to the tree, which shows on the left of the file explorer control.
[Browsable(false)]
public virtual RadTreeView TreeView { get; }
Gets a reference to the upload component, which shows inside a popup window when the user wants to upload files.
[Browsable(false)]
public RadUpload Upload { get; }
Determines which of the FileExplorer controls will be visible(available).
public FileExplorerControls VisibleControls { get; set; }
Gets or sets the width of the Web server control.
public override Unit Width { get; set; }
A System.Web.UI.WebControls.Unit that represents the width of the control. The default is System.Web.UI.WebControls.Unit.Empty.
Exceptions: ArgumentExceptionThe width of the Web server control was set to a negative value.
Overrides:
Gets a reference to the window component, which shows the upload popup and the alert/confirmation dialogs.
[Browsable(false)]
public RadWindowManager WindowManager { get; }
Methods
Rebinds the tree in the RadFileExplorer control. If there were any nodes in the tree when this method is called, they will be cleared unless you set the RadFileExplorer.Tree.AppendDataBoundItems property to true.
protected void BindExplorer()
Code moved into this method from OnPreRender to make sure it executed when the framework skips OnPreRender() for some reason
protected override void ControlPreRender()
Overrides:
protected override void CreateChildControls()
Overrides:
protected override void DescribeComponent(IScriptDescriptor descriptor)
Overrides:
Get the Grid data for the current selected folder in the file explorer tree
protected virtual List<FileBrowserItem> GetExplorerData(string path, string sortExpression, int startIndex, int maxRowNumber, bool includeFiles, string control, out int itemsCount, string filterKeyWord)
path to current selected folder
sortExpressionstringsort argument (column and direction)
startIndexintthe index of the first item to return (used for paging)
maxRowNumberintthe number of items to return (used for paging)
includeFilesboolif set to true, will return files and folders, otherwise only folders
controlstringthe control that needs the data ("grid" or "tree")
itemsCountintout parameter - set to the number of items returned
filterKeyWordstringthe keyword used to filter the items in the grid
Returns:a list of files and folders in the selected path
Get the Grid data for the current selected folder in the file explorer tree
protected virtual List<FileBrowserItem> GetExplorerData(string path, string sortExpression, int startIndex, int maxRowNumber, bool includeFiles, string control, out int itemsCount)
path to current selected folder
sortExpressionstringsort argument (column and direction)
startIndexintthe index of the first item to return (used for paging)
maxRowNumberintthe number of items to return (used for paging)
includeFilesboolif set to true, will return files and folders, otherwise only folders
controlstringthe control that needs the data ("grid" or "tree")
itemsCountintout parameter - set to the number of items returned
Returns:a list of files and folders in the selected path
protected virtual void InitContentProvider()
Determines if the "MetroTouch" is used by the RadFileExplorer control.
protected virtual bool IsMetroTouchSkin()
True if "MetroTouch" skin is used, false otherwise.
Restores view-state information from a previous request that was saved with the System.Web.UI.WebControls.WebControl.SaveViewState() method.
protected override void LoadViewState(object state)
An object that represents the control state to restore.
Overrides:
Fired when the grid data is retrieved from the content provider.
protected virtual void OnExplorerPopulated(RadFileExplorerPopulatedEventArgs e)
an instance of the RadFileExplorerEventArgs event argument.
Fired when on all file explorer file and folder operations.
protected virtual void OnItemCommand(RadFileExplorerEventArgs e)
an instance of the RadFileExplorerEventArgs event argument.
This method is used in the RadTreeView1_NodeExpand handler, in the TreeUpdatePanel_AjaxRequest method, when a folder is created and in the TreeUpdatePanel_AjaxRequest method, in order to reach a node in the tree
protected void PopulateTreeNode(RadTreeNode currNode)
The node to be populated
protected virtual void RadTreeView1_NodeDrop(object sender, RadTreeNodeDragDropEventArgs e)
Handle Renaming of folders
protected void RadTreeView1_NodeEdit(object sender, RadTreeNodeEditEventArgs e)
tree instance
eRadTreeNodeEditEventArgsrename event arguments
Implemented using ASP.NET 2.0 Callback functionality built into RadTreeView
protected void RadTreeView1_NodeExpand(object sender, RadTreeNodeEventArgs e)
the tree instance
eRadTreeNodeEventArgsevent arguments
protected void RaiseFileExplorerExplorerPopulated(RadFileExplorerPopulatedEventArgs e, object eventKey)
protected void RaiseFileExplorerItemEvent(RadFileExplorerEventArgs e, object eventKey)
protected override void RenderChildren(HtmlTextWriter writer)
Overrides:
Saves any state that was modified after the System.Web.UI.WebControls.Style.TrackViewState() method was invoked.
protected override object SaveViewState()
An object that contains the current view state of the control; otherwise, if there is no view state associated with the control, null.
Overrides:
Causes the control to track changes to its view state so they can be stored in the object's System.Web.UI.Control.ViewState property.
protected override void TrackViewState()
Overrides:
Updates the strings that are localizable in the FileExplorer controls. Useful if you change the Localization collection after it has already set the values to the controls.
protected void UpdateLocalization()
Events
This event is fired when the grid data is retrieved from the content provider
public event RadFileExplorerGridEventHandler ExplorerPopulated
This event is fired when on all file and folder operations of the file explorer. If you wish to cancel the command simply return False from your event handler.
public event RadFileExplorerEventHandler ItemCommand