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

Toolbar click event

4 Answers 77 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Hazeest
Top achievements
Rank 1
Hazeest asked on 07 Feb 2010, 01:49 PM
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

4 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 08 Feb 2010, 03:16 PM
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.
0
asif
Top achievements
Rank 1
answered on 14 Feb 2012, 03:14 PM
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?
0
Tina Stancheva
Telerik team
answered on 17 Feb 2012, 02:49 PM
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 >>
0
asif
Top achievements
Rank 1
answered on 20 Feb 2012, 01:37 PM
hi Tina Stancheva

Thank you for your valuable information.

Regards

Asif
Tags
ToolBar
Asked by
Hazeest
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
asif
Top achievements
Rank 1
Share this question
or