Custom Toolbar Button Not Working Properly

2 posts, 0 answers
  1. Redmond Rinehart
    Redmond Rinehart avatar
    10 posts
    Member since:
    Feb 2008

    Posted 22 Oct 2009 Link to this post

    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.
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 28 Oct 2009 Link to this post

    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.
Back to Top