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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

144026 Apr 15,2019 11:29 AM UTC Apr 16,2019 08:47 AM UTC WPF 5
loading
Tags: GanttControl
Ander Caloca
Asked On April 15, 2019 11:29 AM UTC

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.

Muneesh Kumar G [Syncfusion]
Replied On 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. 


Ander Caloca
Replied On 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?


Muneesh Kumar G [Syncfusion]
Replied On 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. 


Ander Caloca
Replied On April 16, 2019 08:29 AM UTC

Hi Muneesh,

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

Regards.



Muneesh Kumar G [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon