We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to disable the resizing and the drag and drop of appointments

Hello,

I am working with a GanttControl with an item datasource, so I don´t want to be able to move and resize appointments. How can i do it? 

Thanks in advance.

5 Replies

MK Muneesh Kumar G Syncfusion Team April 15, 2019 11:46 AM UTC

Hi Ander, 
 
Greetings from Syncfusion,  
 
We have analyzed your requirement and you can achieve this by disabling the GanttChart as per the below code snippet. 

       
<!--  Gantt Control Information  --> 
<gantt:GanttControl x:Name="Gantt" 
                    ItemsSource="{Binding TaskDetails}" 
                    VisualStyle="Metro" 
                    Loaded="Gantt_OnLoaded"> 
</gantt:GanttControl> 
 
private void Gantt_OnLoaded(object sender, RoutedEventArgs e) 
{ 
    GanttChart chart = this.Gantt.FindElementOfType<GanttChart>(); 
    if (chart != null) 
    { 
        chart.IsEnabled = false; 
    } 
} 
 
We have prepared a sample based on this, please find the sample from the following location.  
 
 
Hope it helps you.  
 
Thanks, 
Muneesh Kumar G. 



AC Ander Caloca April 15, 2019 12:04 PM UTC

Hi Muneesh,

I implement the code that you pass and the drag, drop and resize works perfectly, but with the property isenabled as false i am not able to see the tooltip information. Can I disable the drag,drop,resize properties but not the tooltip?



MK Muneesh Kumar G Syncfusion Team April 16, 2019 07:27 AM UTC

Hi Ander, 
 
Thanks for you update. 
 
We have achieved your requirement by applying custom node style (removed the touch points & disabled the dragging and resizing thumbs in the default node style) as per the below snippet 
 
Code snippet: 
<!--  GanttControl Information  --> 
<sync:GanttControl x:Name="Gantt" 
     
   <sync:GanttControl.Resources> 
        <Style BasedOn="{StaticResource HeaderNode}" TargetType="chart:HeaderNode" /> 
        <Style BasedOn="{StaticResource TaskNode}" TargetType="chart:GanttNode" /> 
        <Style BasedOn="{StaticResource MileStone}" TargetType="chart:MileStone" /> 
    </sync:GanttControl.Resources> 
    … 
</sync:GanttControl> 
 
Please find the sample from the below link. 
 
To know more about custom node style. Please refer the following user guide link. 
 
Please let us know if you have any other queries. 
 
Regards, 
Muneesh Kumar G. 



AC Ander Caloca April 16, 2019 08:29 AM UTC

Hi Muneesh,

Thank you for your answer and attention. Now it works perfectly.

Regards.




MK Muneesh Kumar G Syncfusion Team April 16, 2019 08:47 AM UTC

Hi Ander,  
 
Glad that the requirement has been achieved and please get back to us if you need any other assistance. 
 
Regards, 
Muneesh Kumar G. 


Loader.
Live Chat Icon For mobile
Up arrow icon