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

Custom Toolbar Button Not Working Properly

1 Answer 174 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Redmond Rinehart
Top achievements
Rank 1
Redmond Rinehart asked on 22 Oct 2009, 06:08 PM
I am trying to add a button to the RadFileExplorer's Toolbar that will allow a user to rename a file (but will run custom programming in the code-behind), and I added the button to the Toolbar as follows:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
        AddHandler rfeDocuments.ToolBar.ButtonClick, AddressOf toolBar_ButtonClick 
        Dim customButton As New RadToolBarButton() 
        customButton.CssClass = "test_button" 
        customButton.CommandName = "Rename" 
        customButton.Value = "TEST" 
        customButton.Text = "Rename" 
        rfeDocuments.ToolBar.Items.Add(customButton) 
End Sub 

This makes the button display in the toolbar properly.  I then try to capture the Click event using the following code:
    Protected Sub toolBar_ButtonClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarEventArgs) 
        Label1.Text = e.Item.Value
    End Sub 

When I click my Rename button, the Label says "Delete".  When I click the Refresh or Open buttons, the label displays the correct Value.  I have also tried capturing the Text of e.Item and that has not worked either, it comes back as  .  Do you have any examples of a fully functioning custom button working on the RadFileExplorer.Toolbar with the Click event being handled?  My goal is to prompt the user for the new filename then create a copy of the selected file with the new name.

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 28 Oct 2009, 08:07 AM
Hi Redmond,

In your case you need to use client-side and server-side code in order to implement the desired behavior.
I believe that these links will be of help :

Regards,
Fiko
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
Redmond Rinehart
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or