New to Telerik UI for ASP.NET MVC? Download free 30-day trial

PDFViewerToolbarSettingsItemBuilder

Methods

Type(System.String)

Specifies the type of the Toolbar tool.

Parameters

value - System.String

The value that configures the type.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("pager").Type("pager");
                    })
                )
             )

Overflow(System.String)

Parameters

value - System.String

The value that configures the overflow.

Command(System.String)

Sets the command of the Toolbar tool. The default commands are: 'OpenCommand', 'PageChangeCommand', 'DownloadCommand', 'EnableSelectionCommand', 'EnablePanCommand', 'ExportCommand', 'PrintCommand', 'OpenSearchCommand', and 'ZoomCommand'.

Parameters

value - System.String

The value that configures the command.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Command("PageChangeCommand").Type("pager").Name("pager");
                    })
                )
             )

Name(System.String)

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

Parameters

value - System.String

The value that configures the name.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Type("pager").Name("pager");
                    })
                )
             )

Click(System.Func)

Specifies the click event handler of the tool button.

Parameters

handler - System.Func<Object,Object>

The value that configures the click action.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Command("PrintCommand").Type("button").Name("print").Click(@<text>
                            function(e) {
                                // Handle the Click event inline.
                            }
                        </text>);
                    })
                )
             )

Click(System.String)

Specifies the click event handler of the tool button.

Parameters

handler - System.String

The value that configures the click action.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Command("PrintCommand").Type("button").Name("print").Click("onPrintClick");
                    })
                )
             )

Toggle(System.String)

Specifies the toggle event handler of the tool button. Applicable only for commands of type "button" and Togglable(true).

Parameters

value - System.String

The value that configures the toggle.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Command("PrintCommand").Type("button").Name("print").Togglable(true).Toggle("onPrintClick");
                    })
                )
             )

Togglable(System.Boolean)

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

Parameters

value - System.Boolean

The value that configures the togglable.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Command("PrintCommand").Type("button").Name("print").Togglable(true).Toggle("onPrintClick");
                    })
                )
             )

Text(System.String)

Sets the text of the tool button.

Parameters

value - System.String

The value that configures the text.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").Text("Custom tool");
                    })
                )
             )

Template(System.String)

Specifies what element will be added in the ToolBar wrapper. Items with template do not have a Type().

Parameters

value - System.String

The value that configures the template.

Example

 ");
                    })
                )
             )

TemplateId(System.String)

Specifies the 'id' of the Kendo UI template that contains the tool element. Items with template do not have a Type().

Parameters

value - System.String

The value that configures the template.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").Template("customToolTemplate");
                    })
                )
             )

TemplateView(System.Web.Mvc.MvcHtmlString)

Specifies a Partial View that contains the tool element. Items with template do not have a Type().

Parameters

value - System.Web.Mvc.MvcHtmlString

The value that configures the template.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").TemplateView(Html.Partial("_CustomToolTemplatePartial"));
                    })
                )
             )

TemplateHandler(System.String)

Specifies the event handler that returns the element that will be added in the ToolBar wrapper. Items with template do not have a Type().

Parameters

value - System.String

The value that configures the template.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").TemplateHandler("customToolTemplate");
                    })
                )
             )

Template(Kendo.Mvc.UI.TemplateBuilder)

Specifies the template of the tool. Items with template do not have a Type().

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the template.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").Template(Html.Kendo().Template().AddComponent(btn => btn.Button().Name("customBtn").Content("Custom tool")));
                    })
                )
             )

ShowText(System.String)

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

Parameters

value - System.String

The value that configures the showtext.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").ShowText("both");
                    })
                )
             )

Primary(System.Boolean)

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

Parameters

value - System.Boolean

The value that configures the primary.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").Primary(true);
                    })
                )
             )

HtmlAttributes(System.Object)

Specifies the HTML attributes of the ToolBar button.

Parameters

value - System.Object

The value that configures the htmlattributes.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").HtmlAttributes(new { style = "color: green;" });
                    })
                )
             )

HtmlAttributes(System.Collections.Generic.IDictionary)

Parameters

value - System.Collections.Generic.IDictionary<String,Object>

Enable(System.Boolean)

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

Parameters

value - System.Boolean

The value that configures the enable.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").Type("button").Text("custom").Enable(false);
                    })
                )
             )

Hidden(System.Boolean)

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

Parameters

value - System.Boolean

The value that configures the hidden.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").Type("button").Text("custom").Hidden(true);
                    })
                )
             )

SpriteCssClass(System.String)

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

Parameters

value - System.String

The value that configures the spritecssclass.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").Type("button").Text("custom").SpriteCssClass("customIconClass");
                    })
                )
             )

ImageUrl(System.String)

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

Parameters

value - System.String

The value that configures the imageurl.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").Type("button").Text("custom").ImageUrl(Url.Content("~/Content/shared/icons/16/star.png"));
                    })
                )
             )

ShowIcon(System.String)

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

Parameters

value - System.String

The value that configures the showicon.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").Type("button").Text("custom").ShowIcon("both");
                    })
                )
             )

Icon(System.String)

Sets icon for the item. The icon should be one of the existing in the Kendo UI theme sprite.

Parameters

value - System.String

The value that configures the icon.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").Type("button").Text("custom").Icon("user");
                    })
                )
             )

Id(System.String)

Specifies the ID of the button.

Parameters

value - System.String

The value that configures the id.

Example


            @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .Toolbar(toolbar =>
                    toolbar.Items(items =>
                    {
                        items.Add().Name("custom").Type("button").Text("custom").Id("custom-btn-1");
                    })
                )
             )

In this article
Not finding the help you need?