New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Kendo UI Draggable TagHelper DraggableTagHelper class.

Definition

Namespace:Kendo.Mvc.TagHelpers

Assembly:Kendo.Mvc.dll

Syntax:

C#
[HtmlTargetElement("body", Attributes = "kendo-draggable")]
[HtmlTargetElement("div", Attributes = "kendo-draggable")]
[HtmlTargetElement("form", Attributes = "kendo-draggable")]
[HtmlTargetElement("ul", Attributes = "kendo-draggable")]
[HtmlTargetElement("ol", Attributes = "kendo-draggable")]
[HtmlTargetElement("p", Attributes = "kendo-draggable")]
[HtmlTargetElement("a", Attributes = "kendo-draggable")]
[HtmlTargetElement("table", Attributes = "kendo-draggable")]
[HtmlTargetElement("nav", Attributes = "kendo-draggable")]
public class DraggableTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent

Inheritance: objectTagHelperTagHelperBaseDraggableTagHelper

Implements: ITagHelperITagHelperComponent

Inherited Members TagHelperBase.MinimumValidatorTagHelperBase.MaximumValidatorTagHelperBase.Init(TagHelperContext)TagHelperBase.Process(TagHelperContext, TagHelperOutput)TagHelperBase.GetInitializator()TagHelperBase.VerifySettings()TagHelperBase.SerializeTemplates()TagHelperBase.GenerateId(TagHelperOutput)TagHelperBase.CreateHandler(string)TagHelperBase.GetRangeValidationParameter<TValue>(ModelExplorer, string)TagHelperBase.ExtractEditFormat(string)TagHelperBase.ToDictionaryHandler(IDictionary<string, string>)TagHelperBase.AddSelfToTemplate(TagHelperContext)TagHelperBase.ViewContextTagHelperBase.GeneratorTagHelperBase.InitializerTagHelperBase.WriterTagHelperBase.ScriptAttributesTagHelperBase.NameTagHelperBase.IdTagHelperBase.SelectorTagHelperBase.IdPrefixTagHelperBase.IsInClientTemplateTagHelperBase.DeferredTagHelperBase.AsModuleTagHelper.Orderobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Example:

csharp
@addTagHelper *, Kendo.Mvc

<div kendo-draggable="true" name="draggable" kendo-auto-scroll="true"></div>

Constructors

Initializes a new instance of the DraggableTagHelper class.

C#
public DraggableTagHelper(IKendoHtmlGenerator generator)
Parameters:generatorIKendoHtmlGenerator

Properties

If set to true the widget will auto-scroll the container when the mouse/finger is close to the top/bottom of it.

C#
[HtmlAttributeName("kendo-auto-scroll")]
public bool? AutoScroll { get; set; }

Represents the Draggable widget Axis

C#
[HtmlAttributeName("kendo-axis")]
public DraggableAxis? Axis { get; set; }

Selector that determines the container to which boundaries the hint movement will be constrained.

C#
[HtmlAttributeName("kendo-container")]
public string Container { get; set; }

Specifies the offset of the hint relative to the mouse cursor/finger. By default, the hint is initially positioned on top of the draggable source offset.

C#
[HtmlAttributeName("kendo-cursor-offset-left")]
public double? CursorOffsetLeft { get; set; }

Specifies the offset of the hint relative to the mouse cursor/finger. By default, the hint is initially positioned on top of the draggable source offset.

C#
[HtmlAttributeName("kendo-cursor-offset-top")]
public double? CursorOffsetTop { get; set; }

The required distance that the mouse should travel in order to initiate a drag.

C#
[HtmlAttributeName("kendo-distance")]
public double? Distance { get; set; }

Selects child elements that are draggable if a widget is attached to a container.

C#
[HtmlAttributeName("kendo-filter")]
public string Filter { get; set; }

Used to group sets of draggable and drop targets. A draggable with the same group value as a drop target will be accepted by the drop target.

C#
[HtmlAttributeName("kendo-group")]
public string Group { get; set; }

Provides a way for customization of the drag indicator. If a function is supplied, it receives one argument - the draggable element's jQuery object.

C#
[HtmlAttributeName("kendo-hint")]
public string Hint { get; set; }

Suitable for touch oriented user interface, in order to avoid collision with the touch scrolling gesture. When set to true, the widget will be activated after the user taps and holds the finger on the element for a short amount of time.The draggable will also be activated by pressing, holding and lifting the finger without any movement. Dragging it afterwards will initiate the drag immediately. The activated mode can be canceled by calling cancelHold.

C#
[HtmlAttributeName("kendo-hold-to-drag")]
public bool? HoldToDrag { get; set; }

Specifies child elements for which the drag will not be initialized. Useful if the draggable contains input elements.

C#
[HtmlAttributeName("kendo-ignore")]
public string Ignore { get; set; }

Attribute initializator for the Kendo Draggable.

C#
[HtmlAttributeName("kendo-draggable")]
public bool? IsEnabled { get; set; }

Fired while dragging. The drag event represents a jQuery mousemove event and contains all the event data of the jQuery Event Object.

C#
[HtmlAttributeName("on-kendo-drag")]
public string OnDrag { get; set; }

Fired when item drag is canceled by pressing the Escape key. The dragcancel event represents a jQuery keyup event and contains all the event data of the jQuery Event Object.

C#
[HtmlAttributeName("on-kendo-dragcancel")]
public string OnDragcancel { get; set; }

Fired when item drag ends. The dragend event represents a jQuery mouseup event and contains all the event data of the jQuery Event Object.

C#
[HtmlAttributeName("on-kendo-dragend")]
public string OnDragend { get; set; }

Fired when item drag starts. The dragstart event represents a jQuery mousedown event and contains all the event data of the jQuery Event Object.

C#
[HtmlAttributeName("on-kendo-dragstart")]
public string OnDragstart { get; set; }

Triggered only when holdToDrag is set to true. Fired before the dragStart event. The hold event represents a jQuery mousedown event and contains all the event data of the jQuery Event Object.

C#
[HtmlAttributeName("on-kendo-hold")]
public string OnHold { get; set; }

Methods

Gets the initialization script.

C#
protected override string GetInitializationScript()
Returns:

string

The initialization script.

Overrides: TagHelperBase.GetInitializationScript()

C#
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters:contextTagHelperContextoutputTagHelperOutputReturns:

Task

Overrides: TagHelper.ProcessAsync(TagHelperContext, TagHelperOutput)

Serializes the defined settings.

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

Overrides: TagHelperBase.Serialize()

SerializeEvents method.

C#
protected override Dictionary<string, object> SerializeEvents()
Returns:

Dictionary<string, object>

Overrides: TagHelperBase.SerializeEvents()

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: TagHelperBase.SerializeSettings()

Writes the HTML output.

C#
protected override void WriteHtml(TagHelperOutput output)
Parameters:outputTagHelperOutput

The TagHelper output.

Overrides: TagHelperBase.WriteHtml(TagHelperOutput)