Unplanned
Last Updated: 17 Sep 2021 12:04 by ADMIN
Yoann
Created on: 17 Sep 2021 11:33
Category: GanttView
Type: Bug Report
1
RadGanttView - when using GanttViewDateTimeEditor calendar does not open after clicking the arrow button

Please refer to the attached gif file.

Steps :

1- Open a cell in edit mode (type Date).

2- Move the mouse outside this cell (without click)

3- Click on the arrow buton to open the calendar without focusing on the date cell (by the right).

5- The calendar does not open. (If we move the mouse over the date cell first, the calendar open fine) 
Attached Files:
1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 17 Sep 2021 12:04

Hi, Yoann,

Please refer to the following code snippet demonstrating how to open the calendar popup when hovering the arrow button:

 

        public RadForm1()
        {
            InitializeComponent();
            
            this.radGanttView1.GanttViewElement.GraphicalViewElement.TimelineStart = new DateTime(2010, 10, 9);
            this.radGanttView1.GanttViewElement.GraphicalViewElement.TimelineEnd = new DateTime(2010, 12, 10);

            //setup data items
            GanttViewDataItem item1 = new GanttViewDataItem();
            item1.Start = new DateTime(2010, 10, 10);
            item1.End = new DateTime(2010, 10, 15);
            item1.Progress = 30m;
            item1.Title = "Summary task.1. title";

            GanttViewDataItem subitem11 = new GanttViewDataItem();
            subitem11.Start = new DateTime(2010, 10, 10);
            subitem11.End = new DateTime(2010, 10, 12);
            subitem11.Progress = 10m;
            subitem11.Title = "Sub-task.1.1 title";

            GanttViewDataItem subitem12 = new GanttViewDataItem();
            subitem12.Start = new DateTime(2010, 10, 12);
            subitem12.End = new DateTime(2010, 10, 15);
            subitem12.Progress = 20m;
            subitem12.Title = "Sub-task.1.2 title";

            //add subitems
            item1.Items.Add(subitem11);
            item1.Items.Add(subitem12);

            this.radGanttView1.Items.Add(item1);

            GanttViewDataItem item2 = new GanttViewDataItem();
            item2.Start = new DateTime(2010, 10, 12);
            item2.End = new DateTime(2010, 10, 18);
            item2.Progress = 40m;
            item2.Title = "Summary task.2. title";

            GanttViewDataItem subitem21 = new GanttViewDataItem();
            subitem21.Start = new DateTime(2010, 10, 12);
            subitem21.End = new DateTime(2010, 10, 13);
            subitem21.Progress = 10m;
            subitem21.Title = "Sub-task.2.1 title";

            GanttViewDataItem subitem22 = new GanttViewDataItem();
            subitem22.Start = new DateTime(2010, 10, 13);
            subitem22.End = new DateTime(2010, 10, 18);
            subitem22.Progress = 30m;
            subitem22.Title = "Sub-task.2.2 title";

            GanttViewDataItem subitem23 = new GanttViewDataItem();
            subitem23.Start = new DateTime(2010, 10, 18);
            subitem23.End = new DateTime(2010, 10, 18);
            subitem23.Title = "Sub-task.2.3 title";

            //add subitems
            item2.Items.Add(subitem21);
            item2.Items.Add(subitem22);
            item2.Items.Add(subitem23);

            this.radGanttView1.Items.Add(item2);

            //add links between items
            GanttViewLinkDataItem link1 = new GanttViewLinkDataItem();
            link1.StartItem = subitem11;
            link1.EndItem = subitem12;
            link1.LinkType = TasksLinkType.FinishToStart;
            this.radGanttView1.Links.Add(link1);

            GanttViewLinkDataItem link2 = new GanttViewLinkDataItem();
            link2.StartItem = subitem21;
            link2.EndItem = subitem22;
            link2.LinkType = TasksLinkType.StartToStart;
            this.radGanttView1.Links.Add(link2);

            GanttViewLinkDataItem link3 = new GanttViewLinkDataItem();
            link3.StartItem = subitem22;
            link3.EndItem = subitem23;
            link3.LinkType = TasksLinkType.FinishToStart;
            this.radGanttView1.Links.Add(link3);

            GanttViewTextViewColumn titleColumn = new GanttViewTextViewColumn("Title");
            GanttViewTextViewColumn startColumn = new GanttViewTextViewColumn("Start");
            GanttViewTextViewColumn endColumn = new GanttViewTextViewColumn("End");

            this.radGanttView1.GanttViewElement.Columns.Add(titleColumn);
            this.radGanttView1.GanttViewElement.Columns.Add(startColumn);
            this.radGanttView1.GanttViewElement.Columns.Add(endColumn);
             
            this.radGanttView1.GanttViewElement.EditorInitialized += GanttViewElement_EditorInitialized;
        }

        private void GanttViewElement_EditorInitialized(object sender, GanttViewItemEditorInitializedEventArgs e)
        {
            GanttViewDateTimeEditor dtEditor = e.Editor as GanttViewDateTimeEditor;
            if (dtEditor != null)
            {
                isOpened = false;
                BaseDateTimeEditorElement el = dtEditor.EditorElement as BaseDateTimeEditorElement; 
                el.Opened -= el_Opened;
                el.Opened += el_Opened;
                el.Closed -= el_Closed;
                el.Closed += el_Closed; 
                el.ArrowButton.MouseEnter -= ArrowButton_MouseEnter;
                el.ArrowButton.MouseEnter += ArrowButton_MouseEnter;
            }
        }

        private void ArrowButton_MouseEnter(object sender, EventArgs e)
        {
            GanttViewDateTimeEditor dtEditor = this.radGanttView1.GanttViewElement.ActiveEditor as GanttViewDateTimeEditor;
            RadDateTimePickerElement el = dtEditor.EditorElement as RadDateTimePickerElement;
            if (!isOpened)
            {
                RadDateTimePickerCalendar calendarBehavior = el.GetCurrentBehavior() as RadDateTimePickerCalendar;
                calendarBehavior.ShowDropDown();
            }
        }

        private void el_Closed(object sender, RadPopupClosedEventArgs args)
        { 
            isOpened = false;
        }

        bool isOpened = false;

        private void el_Opened(object sender, EventArgs e)
        { 
            isOpened = true;
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Attached Files: