Completed
Last Updated: 30 Apr 2018 11:16 by Dimitar
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 25 Apr 2018 11:26
Category: GanttView
Type: Bug Report
0
FIX. RadGanttView - link handles are visible when you hover a task in read-only mode
Even though you can't  modify the tasks you can see the link handles which are usually used for linking different tasks. They shouldn't be displayed when the RadGanttView is in read-only mode.

Workaround: handle the GraphicalViewItemFormatting event and manually hide the link handles: 

        private void radGanttView1_GraphicalViewItemFormatting(object sender, GanttViewGraphicalViewItemFormattingEventArgs e)
        {
            GanttGraphicalViewBaseItemElement itemElement = e.ItemElement as GanttGraphicalViewBaseItemElement;
            if (itemElement != null)
            {
                Console.WriteLine(itemElement.LeftLinkHandleElement.Visibility);
                itemElement.LeftLinkHandleElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                itemElement.LeftLinkHandleElement.PropertyChanged -= LeftLinkHandleElement_PropertyChanged;
                itemElement.LeftLinkHandleElement.PropertyChanged += LeftLinkHandleElement_PropertyChanged;
                itemElement.RightLinkHandleElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                itemElement.RightLinkHandleElement.PropertyChanged -= LeftLinkHandleElement_PropertyChanged;
                itemElement.RightLinkHandleElement.PropertyChanged += LeftLinkHandleElement_PropertyChanged;
            }
        }

        private void LeftLinkHandleElement_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            GanttViewTaskLinkHandleElement linkHanle = sender as GanttViewTaskLinkHandleElement;
            if (e.PropertyName == "Visibility" && linkHanle.Visibility == Telerik.WinControls.ElementVisibility.Visible)
            {
                linkHanle.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
            }
        }
0 comments