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:
This makes the button display in the toolbar properly. I then try to capture the Click event using the following code:
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.
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.