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

Kendo UI PDFViewerToolbarSettingsItem TagHelper PDFViewerToolbarSettingsItemTagHelper class.

Definition

Namespace:Kendo.Mvc.TagHelpers

Assembly:Kendo.Mvc.dll

Syntax:

C#
[HtmlTargetElement("pdfviewer-toolbar-item", ParentTag = "pdfviewer-toolbar-items", TagStructure = TagStructure.NormalOrSelfClosing)]
[RestrictChildren("icon", new string[] { })]
[SuppressTagRendering]
public class PDFViewerToolbarSettingsItemTagHelper : TagHelperCollectionItemBase, ITagHelper, ITagHelperComponent, ITemplateComponent

Inheritance: objectTagHelperTagHelperChildBaseTagHelperCollectionItemBasePDFViewerToolbarSettingsItemTagHelper

Implements: ITagHelperITagHelperComponentITemplateComponent

Inherited Members TagHelperChildBase.Init(TagHelperContext)TagHelperChildBase.AddSelfToContext(TagHelperContext)TagHelperChildBase.CreateHandler(string)TagHelperChildBase.IdPrefixTagHelper.Process(TagHelperContext, TagHelperOutput)TagHelper.Orderobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Example:

csharp
@{
    Layout = "_PdfViewerLayout";
}
@addTagHelper *, Kendo.Mvc

<kendo-pdfviewer name="pdfviewer" as-module="true">
    <toolbar>
        <pdfviewer-toolbar-items>
            <pdfviewer-toolbar-item click="onToolbarItemClick" text="Custom Button" />
        </pdfviewer-toolbar-items>
    </toolbar>
</kendo-pdfviewer>

<script>
    function onToolbarItemClick(){
        //handler logic here
    }
</script>

Child Tagsicon

Constructors

Initializes a new instance of the PDFViewerToolbarSettingsItemTagHelper class.

C#
public PDFViewerToolbarSettingsItemTagHelper()

Properties

Specifies the click event handler of the button.

C#
public string Click { get; set; }

Default commands in the PDF Viewer are: OpenCommand; PageChangeCommand; DownloadCommand; EnableSelectionCommand; EnablePanCommand or ExportCommand.

C#
public string Command { get; set; }

Specifies whether the control is initially enabled or disabled. Default value is "true".

C#
public bool? Enable { get; set; }

Determines if a button is visible or hidden. By default buttons are visible.

C#
public bool? Hidden { get; set; }

Specifies the HTML attributes of a ToolBar button.

C#
public IDictionary<string, object> HtmlAttributes { get; set; }

Sets icon for the item. The icon should be one of the existing in the Kendo UI theme sprite.Set this option to an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.

C#
[HtmlAttributeName("icon")]
public string Icon { get; set; }

Specifies the ID of the button.

C#
public string Id { get; set; }

If set, the ToolBar will render an image with the specified URL in the button.

C#
public string ImageUrl { get; set; }

Specifies the tool's name. Tool definition will be taken from the default collection - kendo.pdfviewer.DefaultTools

C#
public string Name { get; set; }

Specifies the overflow behavior of the toolbar item. Accepts auto, never, or always to control when the item appears in the toolbar's overflow menu.

C#
public string Overflow { get; set; }

Specifies whether the button is primary. Primary buttons receive different styling.

C#
public bool? Primary { get; set; }

Specifies where the button icon will be displayed. Possible values are: "toolbar", "overflow" or "both" (default).

C#
public string ShowIcon { get; set; }

Specifies where the text will be displayed. Possible values are: "toolbar", "overflow" or "both" (default).

C#
public string ShowText { get; set; }

Defines a CSS class (or multiple classes separated by spaces) which will be used for button icon.

C#
public string SpriteCssClass { get; set; }

Specifies what element will be added in the ToolBar wrapper. Items with template does not have a type.

C#
public string Template { get; set; }

Specifies what element will be added in the ToolBar wrapper. Items with template does not have a type. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string TemplateHandler { get; set; }

Specifies what element will be added in the ToolBar wrapper. Items with template does not have a type. This option expects the ID of the script element that contains the template.

C#
public string TemplateId { get; set; }

Configures the templates for the PDFViewerToolbarSettingsItem.

C#
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }

Implements: ITemplateComponent.Templates

Specifies what element will be added in the ToolBar wrapper. Items with template does not have a type. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent TemplateView { get; set; }

Sets the text of the button.

C#
public string Text { get; set; }

Specifies if the button is togglable, e.g. has a selected and unselected state.

C#
public bool? Togglable { get; set; }

Specifies the toggle event handler of the button. Applicable only for commands of type button and togglable: true.

C#
public string Toggle { get; set; }

Specifies the type of toolbar item to be rendered. Supported types include button, separator, spacer, splitButton, buttonGroup, and template as defined by the ToolBar component.

C#
public string Type { get; set; }

Methods

Adds the current TagHelper instance to its parent TagHelper.

C#
protected override void AddSelfToParent(TagHelperContext context)
Parameters:contextTagHelperContext

The TagHelper context.

Overrides: TagHelperChildBase.AddSelfToParent(TagHelperContext)

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

Task

Overrides: TagHelperChildBase.ProcessAsync(TagHelperContext, TagHelperOutput)

Serializes the defined settings.

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

Dictionary<string, object>

Serializes the defined templates.

C#
public Dictionary<string, object> SerializeTemplates()
Returns:

Dictionary<string, object>