This is a migrated thread and some comments may be shown as answers.

Using RADTOOLBAR Custom Button in RADFILEEXPLORER server-side

1 Answer 223 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Ajay
Top achievements
Rank 2
Ajay asked on 05 Oct 2009, 10:01 AM
Hi Telerik !

I using an RADFILEEXPLORER in my project.
I have added an custom button named "ARCHIVE" (that I want it to work like Iam archiving an folder/file) using an RadToolBarButton class.

Since all your methods to MOVE, CREATE, DELETE file & directory are OVERRIDEN methods in CustomFileSystemProvider.cs.
i.e. For example : For COPY DIRECTORY method :-

public override string CopyDirectory(string virtualSourcePath, string virtualDestPath)
    {
     } 

Please suggest how to implement the same feature for "ARCHIVE" folder/file.

How to get the parameters for the above mentioned method in case of "ARCHIVE FILE".

Upto now , I have proceded as :-

 
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
        string eventArg = Request["__EVENTARGUMENT"];  
        if (eventArg == "Archive")  
        {  
            Archive();  
        }  
 
        string DocumentPath = ConfigurationManager.AppSettings["DocumentPath"].ToString() + "SharedDocuments\\";  
        string[] viewPaths = new string[] { DocumentPath };  
        string[] uploadPaths = new string[] { DocumentPath };  
        string[] deletePaths = new string[] { DocumentPath };  
 
        DocumentsRadFileExplorer.Configuration.ViewPaths = viewPaths;  
        DocumentsRadFileExplorer.Configuration.UploadPaths = uploadPaths;  
        DocumentsRadFileExplorer.Configuration.DeletePaths = deletePaths;  
        //DocumentsRadFileExplorer.Configuration.SearchPatterns = new string[] { "*.txt" };  
        DocumentsRadFileExplorer.Configuration.ContentProviderTypeName = typeof(CustomFileSystemProvider).AssemblyQualifiedName;  
        if (!IsPostBack)  
        {  
            RadToolBarButton customButton = new RadToolBarButton("Archive");  
            customButton.CssClass = "test_button";  
            customButton.Value = "Archive";  
            customButton.CommandName = "Archive";  
            DocumentsRadFileExplorer.ToolBar.Items.Add(customButton);  
            //context menu item  
            RadMenuItem customMenuOption = new RadMenuItem("Archive");  
            customMenuOption.Value = "custom_Menu";  
            DocumentsRadFileExplorer.TreeView.ContextMenus[0].Items.Add(customMenuOption);  
            //if you want the custom context menu item to be visible in the grid as well  
            DocumentsRadFileExplorer.GridContextMenu.Items.Add(customMenuOption.Clone());  
            //DocumentsRadFileExplorer.ToolBar.ButtonClick += new RadToolBarEventHandler(toolBar_ButtonClick);  
        }  
    }  
 
    public void Archive()  
    {  
        string val = DocumentsRadFileExplorer.TreeView.SelectedNode.Value;  
       
        FileSystem.ArchiveFolder();  
    } 

Please suggest that how can I pass the PARAMETERS that I have made STORED PROCEDURE at application end.

Please help ! 

1 Answer, 1 is accepted

Sort by
0
Lini
Telerik team
answered on 08 Oct 2009, 11:46 AM
Hello Ajay,

You can use a ajax panel with a button inside and simulate a click on this button when the user clicks the archive command on the toolbar. I am attaching a simple page that demonstrates how to do that.

Greetings,
Lini
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
FileExplorer
Asked by
Ajay
Top achievements
Rank 2
Answers by
Lini
Telerik team
Share this question
or