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

Header item selected event

6 Answers 110 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 26 Sep 2011, 02:29 PM
Hi,

in my RadOutLookBar, I have mutltiple group section, for each section, I have multiple buttons. When the user click on an header group item, I show a graphical representation of his stats, if the user click on a button attach to the group, I display a grid. If the user want his graphic back, he cannot just click on the group header item again because the selection_changed event wasn't fired.

What is the best approach the handle this?

Thank's

6 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 29 Sep 2011, 01:06 PM
Hi Oliver,

You can use the MouseLeftButtonDown event of the RadOutlookBar and check what is the Control that you have clicked on. Please note that this event is handled by the Selection events but you can easily use it if you define it like so:

this.myOutlookBar.AddHandler(RadOutlookBar.MouseLeftButtonDownEvent, new MouseButtonEventHandler(MyEventHandlerName),true)
You can also check out this msdn article for further reference.
Please let us know if you need further assistance on this.All the best,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Oliver
Top achievements
Rank 1
answered on 18 Oct 2011, 08:01 PM
Hi,

with this solution, of course, the user can click onto the header to get his graphic back but if he click back on the item itself in the RadOutlookBar, it doesn't work :(

Thank's
0
Petar Mladenov
Telerik team
answered on 21 Oct 2011, 12:28 PM
Hello Oliver,

 Is it possible for you to send us your XAML and the exact desired result when clicking on the different parts of the RadOutlookbarItem? This way we would be better able to advice you and think up something elegant. Thank you for your cooperation in advance.

Greetings,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Oliver
Top achievements
Rank 1
answered on 21 Oct 2011, 03:04 PM
Hi,

what I'm trying to do is, when the user click on an RadOutlookBarItem, I want to show him a graphic as a default representation regarding his selection. At this moment, the RadOutlookBar deploy the selected item section. After that, the user can click on different buttons in the section so at this point, I remove the graphic to display another control. If the user want is graphic back, he cannot just click on the same RadOutlookBarItem to get his graphic back. He have two choices, the first one is to click on the header of the deployed section or the second one, he have to select another RadOutlookBarItem and select back the RadOutlookBarItem from which he eant his graphic representation.

 

Here is the XAML:

<

 

Window x:Class="WpfApplication1.Window1"

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

 

 

Title="Window1" Height="300" Width="300" Loaded="Window_Loaded">

 

 

 

<Grid>

 

 

 

<telerik:RadOutlookBar Height="Auto" Name="radOutlookBar1" Width="Auto" SelectionChanged="radOutlookBar1_SelectionChanged" MouseLeftButtonDown="radOutlookBar1_MouseLeftButtonDown">

 

 

 

<telerik:RadOutlookBarItem Header="To send" FontWeight="Bold" />

 

 

 

<telerik:RadOutlookBarItem Header="To receive" FontWeight="Bold" />

 

 

 

</telerik:RadOutlookBar>

 

 

 

</Grid>

 

</

 

Window>

 



Here is the CS file:

using

 

System;

 

using

 

System.Collections.Generic;

 

using

 

System.Linq;

 

using

 

System.Text;

 

using

 

System.Windows;

 

using

 

System.Windows.Controls;

 

using

 

System.Windows.Data;

 

using

 

System.Windows.Documents;

 

using

 

System.Windows.Input;

 

using

 

System.Windows.Media;

 

using

 

System.Windows.Media.Imaging;

 

using

 

System.Windows.Navigation;

 

using

 

System.Windows.Shapes;

 

using

 

Telerik.Windows.Controls;

 

namespace

 

WpfApplication1

 

{

 

/// <summary>

 

 

/// Interaction logic for Window1.xaml

 

 

/// </summary>

 

 

public partial class Window1 : Window

 

{

 

public Window1()

 

{

InitializeComponent();

}

 

private void Window_Loaded(object sender, RoutedEventArgs e)

 

{

}

 

private void radOutlookBar1_SelectionChanged(object sender, Telerik.Windows.Controls.RadSelectionChangedEventArgs e)

 

{

 

RadOutlookBarItem item = (sender as RadOutlookBar).SelectedItem as RadOutlookBarItem;

 

 

MessageBox.Show(item.Header.ToString());

 

}

 

private void radOutlookBar1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)

 

{

 

RadOutlookBarItem item = (sender as RadOutlookBar).SelectedItem as RadOutlookBarItem;

 

 

MessageBox.Show(item.Header.ToString());

 

}

}

}

0
Petar Mladenov
Telerik team
answered on 26 Oct 2011, 01:51 PM
Hi Oliver,

 Please examine the attached project where the PreviewMouseLeftButtonDown event is used and let us know if it satisfies you. Thank you in advance.

Best wishes,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Oliver
Top achievements
Rank 1
answered on 26 Oct 2011, 04:54 PM
That's exactly what I need :)

Thank's you guys :)
Tags
OutlookBar
Asked by
Oliver
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Oliver
Top achievements
Rank 1
Share this question
or