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

BarcodeBuilder

Methods

Value(System.String)

Sets the initial value of the Barcode.

Parameters

value - System.String

The value that configures the Barcode value.

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("ABC")
                )

RenderAs(Kendo.Mvc.UI.RenderingMode)

Sets the preferred rendering engine. If it is not supported by the browser, the Barcode will switch to the first available mode.

Parameters

renderAs - RenderingMode

The preferred rendering engine.

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("1234567")
                   .RenderAs(RenderingMode.SVG)
                )

Value(System.Int32)

Sets the value of the barcode

Parameters

value - System.Int32

The value that configures the Barcode value.

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("1234567")
                )

Background(System.String)

Sets the background color of the Barcode area. The option accepts a valid CSS color string, including HEX and RGB.

Parameters

value - System.String

The value that configures the background color.

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("1234567")
                   .Background("#2eb3a6")
                )

Border(System.Action)

Configures the options for the border of the Barcode.

Parameters

configurator - System.Action<BarcodeBorderBuilder>

The action that configures the border.

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("1234567")
                   .Border(border => border.Width(1).Color("#10c4b2").DashType(ChartDashType.Dot))
                )

Padding(System.Action)

Configurator to fine tune the padding of the Barcode.

Parameters

configurator - System.Action<BarcodeSpacingBuilder>

The action that configures the padding options .

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("1234567")
                   .Padding(x => x.Left(100).Top(50).Right(100).Bottom(20))
                )

Padding(System.Int32)

Specifies the padding of the Barcode for top, bottom, right, and left at once.

Parameters

padding - System.Int32

The configurator for the padding setting.

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("1234567")
                   .Padding(50)
                )

Checksum(System.Boolean)

If set to 'true', the Barcode will display the checksum digit next to the value in the text area.

Parameters

checksum - System.Boolean

The value for the visibility of the checksum digit.

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("1234567")
                   .Checksum(true)
                )

Color(System.String)

Specifies the color of the bar elements. The option accepts a valid CSS color string, including HEX and RGB.

Parameters

color - System.String

The configuration of the color setting.

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("1234567")
                   .Color("#10c4b2")
                )

Text(System.Action)

Configures options for the text of the Barcode.

Parameters

configurator - System.Action<BarcodeTextBuilder>

The action that configures the text settings.

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("1234567")
                   .Text(text => text.Color("#2eb3a6").Font("20px sans-serif").Margin(25).Visible(true))
                )

Encoding(Kendo.Mvc.UI.BarcodeSymbology)

Sets the symbology (encoding) that will be used to encode the value of the Barcode.

Parameters

encoding - BarcodeSymbology

The configuration for the encoding setting.

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("1234567")
                   .Encoding(BarcodeSymbology.EAN8)
                )

Height(System.Int32)

Sets the height of the Barcode area.

Parameters

height - System.Int32

The value for the height option.

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("1234567")
                   .Height(200)
                )

Width(System.Int32)

Sets the width of the Barcode area.

Parameters

width - System.Int32

The value for the width option.

Example


                @(Html.Kendo().Barcode()
                   .Name("barcode")
                   .Value("1234567")
                   .Width(200)
                )

ToComponent()

Returns the internal view component.

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name of the component.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
               .Name("grid")
               .Columns(columns =>
               {
                   columns.Bound(p => p.OrderID).Filterable(false);
                   columns.Bound(p => p.Freight);
               })
               .DataSource(dataSource => dataSource
                   .Ajax()
                   .PageSize(20)
                   .Read(read => read.Action("Orders_Read", "Grid"))
               )
            )

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with

Parameters

deferred - System.Boolean

ModelMetadata(System.Web.Mvc.ModelMetadata)

Uses the Metadata of the Model.

Parameters

modelMetadata - System.Web.Mvc.ModelMetadata

The metadata set for the Model

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Parameters

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

AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

Parameters

value - System.Boolean

Render()

Renders the component.

Example


            @(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
            @( Html.Kendo().Grid(Model)
                .Name("grid")
                .DetailTemplate(product => {
                    )
                       Product Details:
                       <div>Product Name: @( product.ProductName )</div>
                       <div>Units In Stock: @( product.UnitsInStock )</div>
                    @(
                })
                .Render();
            )

ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Object

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

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

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ToHtmlString()

ToClientTemplate()

In this article
Not finding the help you need?