@Html.EJ().FileExplorer("fileExplorer").FileTypes("*.png, *.gif, *.jpg, *.jpeg, *.docx").Path("~/FileExplorerContent/").AjaxAction(@Url.Content("/FileExplorer/FileActionDefault")).Width("950px").Height("400px").FilterSettings(fs => fs.CaseSensitiveSearch(false).FilterType(FilterOperatorType.Contains)) |
@Html.EJ().FileExplorer("fileExplorer").FileTypes("*.png, *.gif, *.jpg, *.jpeg, *.docx").Path("~/FileExplorerContent/").AjaxAction(@Url.Content("/FileExplorer/FileActionDefault")).Width("950px").Height("400px").FilterSettings(fs => fs.CaseSensitiveSearch(false).FilterType(FilterOperatorType.Contains)).GridSettings(gs => gs.Column(col => { col.Add().Field("name").HeaderText("Name").Width("150px"); col.Add().Field("type").HeaderText("Type").Width("100px"); col.Add().Field("size").HeaderText("Size").Width("100px"); col.Add().Field("createdDate").HeaderText("Date Created").Width("150px"); col.Add().Field("dateModified").HeaderText("Date Modified").Width("150px"); |
public static CustomFileDetails GetDetails(string path, string name, string type) { path = ToAbsolute(path); path = CombinePaths(path, name); try { var physicalPath = ToPhysicalPath(path); FileInfo info = new FileInfo(physicalPath); CustomFileDetails fileDetails = new CustomFileDetails(); fileDetails.Name = info.Name; fileDetails.Type = (info.Extension == "") ? "File Folder" : info.Extension; // Has period fileDetails.Location = info.FullName; fileDetails.Size = type == "File" ? info.Length : new DirectoryInfo(physicalPath).EnumerateFiles("*", SearchOption.AllDirectories).Sum(file => file.Length); ; fileDetails.Created = info.CreationTime.ToString(); fileDetails.Modifed = info.LastWriteTime.ToString(); fileDetails.IsReadOnly = info.IsReadOnly.ToString(); return fileDetails; } catch (Exception ex) { throw ex; } |
Qurey4: How to add more than one custom tool to the file explorer toolbar? I tried with the code below but only one tool icon has been shown:
Using Tool API of file explorer, we can add any number of custom tools with its specific operations. Please refer below code snippet.
Code snippet [CSHTML]:
@{List<String> toolsList = new List<string>() { "customTool" }; } @Html.EJ().FileExplorer("fileExplorer").Path("~/FileExplorerContent/").Width("900px").Height("400px").AjaxAction(@Url.Content("FileActionCustomTool")).ToolsList(toolsList).Tools(tool => tool.CustomTool(custom => { custom.Name("Help").Tooltip("Help").Css("e-fileExplorer-toolbar-icon Help").Action("dialogOpen").Add(); custom.Name("Details").Tooltip("Details").Css("e-fileExplorer-toolbar-icon AdditionalHelp").Action("dialogOpen").Add(); |
Hi Ferry,
Sorry for the inconvenience caused.
Query 1: what I want to do instead is to customize the Tile layout so I can put the file name from bottom to the left of the icon and also showing some custom details, is it possible?
We have analyzed your requirement. Currently there is no support for this. So we have logged this (Provide support to customize the tile layout in file explorer) as a feature request in our database. We will implement this feature in any of our upcoming releases.
Query 2: if the file explorer grid can work like the original Grid component to customize the column template as stated in http://help.syncfusion.com/ug/aspnetmvc/index.html#!Documents/template.htm?
In ASP.NET MVC, Columns API supports Field, HeaderText, Width properties only, not having template support as shown in provided link. So we have logged this (file explorer grid can work like the original grid component to customize the column template as stated) as a feature request in our database. We will implement this feature in any of our upcoming releases.
Please let us know if you have any queries.
Regards,
Balamurugan