What's the best way of disabling the ability for viewers/users to add relations between tasks?
Is there a way of doing it similar to disabling drag-and-drop/resizing? (over-wrote CanStartDrag, CanDrop, CanStartResize, CanResize, etc)
Is there a way of doing it similar to disabling drag-and-drop/resizing? (over-wrote CanStartDrag, CanDrop, CanStartResize, CanResize, etc)
3 Answers, 1 is accepted
0
Hi Nathan,
In order to disable adding relations between GanttTasks you need a custom GanttDragDependenciesBehavior and override the CanStartLink/CanLink methods.
Then use this behavior in the RadGanttView as a DragDependenciesBehavior:
Also you can take a look at our RadGanttView LockingFunctions example where we demonstrate how to disable adding relations, drag&drop and resizing GanttTasks. The examples can be downloaded from this link.
Hopefully this helps.
Regards,
Polya
Telerik
In order to disable adding relations between GanttTasks you need a custom GanttDragDependenciesBehavior and override the CanStartLink/CanLink methods.
public
class
CustomDragDependenciesBehavior : GanttDragDependenciesBehavior
{
protected
override
bool
CanStartLink(SchedulingLinkState state)
{
return
false
;
}
protected
override
bool
CanLink(SchedulingLinkState state)
{
return
false
;
}
}
Then use this behavior in the RadGanttView as a DragDependenciesBehavior:
<
telerik:RadGanttView
TasksSource
=
"{Binding GanttTasks}"
VisibleRange
=
"{Binding VisibleRange}"
>
<
telerik:RadGanttView.Columns
>
...
</
telerik:RadGanttView.Columns
>
<
telerik:RadGanttView.DragDependenciesBehavior
>
<
local:CustomDragDependenciesBehavior
/>
</
telerik:RadGanttView.DragDependenciesBehavior
>
</
telerik:RadGanttView
>
Also you can take a look at our RadGanttView LockingFunctions example where we demonstrate how to disable adding relations, drag&drop and resizing GanttTasks. The examples can be downloaded from this link.
Hopefully this helps.
Regards,
Polya
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0

Nathan
Top achievements
Rank 1
answered on 18 Jun 2014, 10:02 PM
I've figured out how to disable creating relations between tasks. But the tooltip that says "Drag to create a relation" still appears.
Is it possible to disable this tooltip from appearing?
Is it possible to disable this tooltip from appearing?
0
Hello Nathan,
In order to stop showing the "Drag to create a relation" we need to remove this ToolTip from the ControlTemplate of the DependencyIndicator. Then we need to use this new ControlTemplate in the Style of the DependencyIndicator and apply this style for the DependencyIndicators in the ControlTemplate of the EventDecoratorContainer.
Please find attached a sample project demonstrating this styling. Note that the project uses Implicit Styles.
Give it a try and let me know if it works for you.
Regards,
Polya
Telerik
In order to stop showing the "Drag to create a relation" we need to remove this ToolTip from the ControlTemplate of the DependencyIndicator. Then we need to use this new ControlTemplate in the Style of the DependencyIndicator and apply this style for the DependencyIndicators in the ControlTemplate of the EventDecoratorContainer.
Please find attached a sample project demonstrating this styling. Note that the project uses Implicit Styles.
Give it a try and let me know if it works for you.
Regards,
Polya
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.