Hi,
Can I add custom MenuItem "Add Permission" to Folder or File of FileExplorer?? and on Click on that Menu Item I want to open a popup or new Window where I can pass the ItemID as querystring or something of selected Folder. Here is my code
<telerik:RadFileExplorer VisibleControls="TreeView,Toolbar,ListView,Grid,FileList,ContextMenus"
runat="server" ID="RadFileExplorer1" OnClientItemSelected="OnClientItemSelected"
EnableOpenFile="true">
</telerik:RadFileExplorer>
protected void Page_Load(object sender, System.EventArgs e)
{
RadFileExplorer1.Configuration.SearchPatterns = new string[] { "*.jpg", "*.jpeg"};
RadFileExplorer1.Configuration.ContentProviderTypeName = typeof(DBContentProvider).AssemblyQualifiedName;
RadFileExplorer1.Configuration.ViewPaths = new string[] { "Files" };
RadFileExplorer1.Configuration.UploadPaths = new string[] { "Files" };
RadFileExplorer1.Configuration.DeletePaths = new string[] { "Files" };
}
6 Answers, 1 is accepted
Yes, you can add a custom button to the FileExplorer's context menu and execute your custom logic when it is clicked. More details are available in the following help article: Adding Custom Command Buttons
As for the accessing the currently selected folder, you can use the FileExplorer's get_selecteditem() method like follows:
$find(
"RadFileExplorer1"
).get_selectedItem();
Regards,
Vessy
Telerik
I mange to remove the error using
var test = $find("<%= RadFileExplorer1.ClientID %>").get_selectedItem();
but, didn't get the ItemID from binded folder value :(
I am afraid that RadFileExplorer does not know about the custom data base fields and so it is not included into the data binding the FileExplorer's file and data items. The only approach I can suggest you is to create a custom RadGrid column in FileExplorer and bind it with the ItemID data. You can see how to implement such logic here:
FileExplorer - Add custom columns
Regards,
Vessy
Telerik
Don't want to get that long.... can you please tell me one thing how to get url or path of selected node in javascript here is my code
RadMenuItem customMenuOption = new RadMenuItem("custom");
customMenuOption.Value = "custom_Menu";
RadFileExplorer1.TreeView.ContextMenus[0].Items.Add(customMenuOption);
RadFileExplorer1.TreeView.OnClientContextMenuItemClicked = "treeContextMenuClicked";
this code is on page_Load and in javascript
function treeContextMenuClicked(toolbar, args) {
//here I want to get path of selected item how to get??
}
You can access the path of the active TreeView node inside the , over which the context menu is shown by getting its value like follows:
function
treeContextMenuClicked(tree, args) {
//get path of selected item
var
activeNodePath = args.get_node().get_value()
}
You can find more detailed information regarding the TreeView's OnClientContextMenuItemClicked event here: OnClientContextMenuItemClicked
Regards,
Vessy
Telerik