New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
OnClientInserting
The OnClientInserting occurs when a new task or a new dependency is about to be added. The event can be canceled. The equivalent of the underlying Kendo UI Gantt add event.
The event handler receives two parameters:
-
The instance of the Gantt control firing the event.
-
An eventArgs parameter containing the following methods:
-
get_task returns the GanttTask instance which will be added to the DataSource.
-
set_cancel lets you cancel the event and prevent the inserting.
-
get_cancel returns true if the event has been canceled.
-
dependency returns the GanttDependency instance which will be added to the DataSource.
-
get_sender returns the underlying Kendo UI Gantt widget that fired the event.
ASP.NET
<telerik:RadGantt RenderMode="Lightweight" runat="server" id="RadGantt1" OnClientInserting="OnClientInserting">
</telerik:RadGantt>
JavaScript
function OnClientInserting(sender, eventArgs) {
// cancel the event
args.set_cancel(true);
}