How to fire the button inside the Tool Bar

3 posts, 0 answers
  1. Jayashree
    Jayashree avatar
    14 posts
    Member since:
    Dec 2008

    Posted 01 Jan 2009 Link to this post

    Hi,

    I am using Telerik Tool Bar , i want to fire the buttons events inside the ToolBar. I have attached the Design.
    <telerik:RadToolBar runat="server" ID="RadToolBar1" CssClass="RadToolBar"
    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        <Items> 
            <telerik:RadToolBarButton Text="Add"  ImageUrl="../App_Themes/images/Add.gif"  CommandName="Insert" > 
            </telerik:RadToolBarButton> 
            <telerik:RadToolBarButton Text="Edit" ImageUrl="../App_Themes/images/Edit.gif" CommandName="Update" > 
            </telerik:RadToolBarButton> 
            <telerik:RadToolBarButton Text="Delete" ImageUrl="../App_Themes/images/deletegrid.gif"  > 
            </telerik:RadToolBarButton> 
            <telerik:RadToolBarButton Text="Save" ImageUrl="../App_Themes/images/Save.gif" > 
            </telerik:RadToolBarButton> 
            <telerik:RadToolBarButton Text="Cancel"
            </telerik:RadToolBarButton> 
        </Items> 
    </telerik:RadToolBar> 
    Plz give me an example. Can any one help me.

    Thanks
    Jaya
  2. Ciaran
    Ciaran avatar
    21 posts
    Member since:
    Jun 2008

    Posted 09 Jan 2009 Link to this post


    simple enough......use a case statement, i was too lazy to write the whole thing out

    Protected Sub RadToolBar1_ButtonClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarEventArgs) Handles RadToolBar1.ButtonClick

            If e.Item.Text = "Add" Then

                      ' do something

            End If

            If e.Item.Text = "Edit" Then
     
                        ' do something

            End If

    ......................and so on

        End Sub
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 04 Feb 2009 Link to this post

    Hi Jaya,

    one more thing : you need to set the AutoPostBack property to true inorder to get the server-side events  from toolbar.

    <telerik:RadToolBar AutoPostback="true" runat="server" ID="RadToolBar1" CssClass="RadToolBar" OnButtonClick="RadToolBar1_ButtonClick" >
    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        <Items> 
    ----
    ---


    -Thanks,
    Princy
Back to Top