Toolbar click event

5 posts, 0 answers
  1. Hazeest
    Hazeest avatar
    12 posts
    Member since:
    Oct 2009

    Posted 07 Feb 2010 Link to this post

    I'm trying to handle Click event in toolbar button.

    <telerikNavigation:RadToolBarTray>
      <telerikNavigation:RadToolBar Band="0" BandIndex="0">
        <Button x:Name="insertImageButton" Click="insertImage_Click" />

    In this way it doesn't work. Is there another way?

    Thanks
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 08 Feb 2010 Link to this post

    Hello Hazeest,

    We were not able to reproduce the problem you descibed. Please take a look at the attached sample project and see if you can modify it to reproduce the problem.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  3. DevCraft banner
  4. asif
    asif avatar
    3 posts
    Member since:
    Aug 2011

    Posted 14 Feb 2012 Link to this post

    hi Telerik team,

    I want a help on this issue with RadToolBar.
    I have a RadToolBar that contains n number of  RadButtons. I want to know the button index or name on user clicks on radtoolbar. Can you suggest an event of RadToolBar by which i can identify the button inside the toolbar?
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 17 Feb 2012 Link to this post

    Hi asif,

    The RadToolBar doesn't expose such an event but you can handle the Click() of the buttons inside the RadToolBar and then you can get the index of the clicked button like this:
    <telerik:RadToolBar Name="toolBar">
        <telerik:RadButton Click="RadButton_Click" Content="Button 1" />
        <telerik:RadButton Click="RadButton_Click" Content="Button 2" />
        <telerik:RadButton Click="RadButton_Click" Content="Button 3" />
        <telerik:RadButton Click="RadButton_Click" Content="Button 4" />
    </telerik:RadToolBar>

    private void RadButton_Click(object sender, RoutedEventArgs e)
    {
       int index = toolBar.Items.IndexOf(sender);
    }
    Can you give this approach a try and let me know if it helps.

    Kind regards,
    Tina Stancheva
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. asif
    asif avatar
    3 posts
    Member since:
    Aug 2011

    Posted 20 Feb 2012 Link to this post

    hi Tina Stancheva

    Thank you for your valuable information.

    Regards

    Asif
Back to Top
DevCraft banner