RadiantQ WPF Gantt
How to listen to DoubleClick events in FlexyGantt taskbar?
Previous Topic  Next Topic 

Here is some sample code to listen to DoubleClick event for FlexyGantt taskbar:


MouseDoubleClick event subscription:



        void fxgantt_TemplateApplied(object sender, EventArgs e)

        {

            // Listening the MouseDoubleClick event for GanttChart.

            this.fxgantt.GanttChart.MouseDoubleClick += GanttChart_MouseDoubleClick;

        } 

       

MouseDoubleClick event handler:

        void GanttChart_MouseDoubleClick(object sender, MouseButtonEventArgs e)

        {

            // Checking if this double click happened on the task bar by checking it's data context

            if (e.OriginalSource is FrameworkElement)

            {

                FrameworkElement fe = ((FrameworkElement)e.OriginalSource);

                if (fe.DataContext != null)

                {

                    Task task = fe.DataContext as Task; // Task is the underlying bound object.

                    if (task != null) // This means double click happened on the task bar.

                    {

                        MessageBox.Show(task.TaskName);

                    }

                }

            }

        }



� RadiantQ 2009 - 2019. All Rights Reserved.