Header item selected event

7 posts, 0 answers
  1. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 26 Sep 2011 Link to this post

    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
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 29 Sep 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 18 Oct 2011 Link to this post

    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
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 21 Oct 2011 Link to this post

    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 >>

  6. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 21 Oct 2011 Link to this post

    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());

     

    }

    }

    }

  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 26 Oct 2011 Link to this post

    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 >>

  8. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 26 Oct 2011 Link to this post

    That's exactly what I need :)

    Thank's you guys :)
Back to Top
UI for WPF is Visual Studio 2017 Ready