- Home
- Forum
- ASP.NET MVC
- Please share .contextMenuSettings syntax require below format and add some setting related to removed "Upload" item from Selected files/ folder's ContextMenu
Please share .contextMenuSettings syntax require below format and add some setting related to removed "Upload" item from Selected files/ folder's ContextMenu
Hi Team,
Please see below format:-
<div class="col-md-10">
@(Html.EJ().FileExplorer("fileExplorer1")
.Path("~/content/images/FileExplorer/")
.AjaxAction(@Url.Content("FileActionDefault"))
.FileTypes("*.pdf")
.ClientSideEvents(evt => evt.LayoutChange("onLayoutChange").Select("onSelect").Unselect("onUnselect").BeforeOpen("onBeforeOpen"))
.AllowMultiSelection(false)
.contextMenuSettings --- Please code add here
.IsResponsive(true)
.ShowToolbar(false)
// under gridSettings you can customize the grid view functionalities
.GridSettings(settings =>
// disables the sorting functionality in grid view
settings.AllowSorting(true)
// it displays 3 columns only, like this you can display your desired columns at here
.Column(column =>
{
column.Add()
.Field("name")
.HeaderText("Name")
.Width("150");
column.Add()
.Field("dateModified")
.HeaderText("Date Modified")
.Width("150");
column.Add()
.Field("size")
.HeaderText("Size")
.Width("90")
.TextAlign(TextAlign.Right)
.HeaderTextAlign(TextAlign.Left);
}
)
)
)
</div>
Thanks for helping
SIGN IN To post a reply.
1 Reply
KR
Karthik Ravichandran
Syncfusion Team
December 22, 2016 12:17 PM UTC
Hi Abhijeet,
Thanks for contacting Syncfusion support.
We have analyzed your query (“ContextMenuSettings Syntax and add the upload option in file selection”). You can achieve your requirement using “ContextMenuSettings” property of FileExplorer. Please refer the below code block.
|
@{List<String> files = new List<string>() { "Open", "Download", "|" , "Upload" , "|", "Delete", "Rename", "|", "Cut", "Copy", "Paste", "|",
"OpenFolderLocation", "Getinfo" };
@(Html.EJ().FileExplorer("fileExplorer1")
.Path("~/content/images/FileExplorer/")
.AjaxAction(@Url.Content("FileActionDefault"))
.FileTypes("*.pdf")
.ClientSideEvents(evt => evt.LayoutChange("onLayoutChange").Select("onSelect").Unselect("onUnselect").BeforeOpen("onBeforeOpen"))
.AllowMultiSelection(false)
.ContextMenuSettings(
settings1 => settings1.Items(
item => item.Files(files)
))
.IsResponsive(true)
.ShowToolbar(false)
// under gridSettings you can customize the grid view functionalities
.GridSettings(settings =>
// disables the sorting functionality in grid view
settings.AllowSorting(true)
// it displays 3 columns only, like this you can display your desired columns at here
.Column(column =>
{
column.Add()
.Field("name")
.HeaderText("Name")
.Width("150");
column.Add()
.Field("dateModified")
.HeaderText("Date Modified")
.Width("150");
column.Add()
.Field("size")
.HeaderText("Size")
.Width("90")
.TextAlign(TextAlign.Right)
.HeaderTextAlign(TextAlign.Left);
}
)
)
)
}
|
Based on your requirement we have prepared the sample to customize the “Contextmenu” in FileExplorer. You can get it from below link.
To know more details about context menu customization, please refer the below link:
Please let us know if you have any concerns.
Regards,
Karthik R
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
AB Abhijeet
- Dec 21, 2016 05:21 PM UTC
- Dec 22, 2016 12:17 PM UTC