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

Defines the fluent API for configuring the Kendo UI Barcode

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class BarcodeBuilder : WidgetBuilderBase<Barcode, BarcodeBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<Barcode, BarcodeBuilder>BarcodeBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<Barcode, BarcodeBuilder>.ToComponent()WidgetBuilderBase<Barcode, BarcodeBuilder>.Expression(string)WidgetBuilderBase<Barcode, BarcodeBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<Barcode, BarcodeBuilder>.Name(string)WidgetBuilderBase<Barcode, BarcodeBuilder>.Deferred(bool)WidgetBuilderBase<Barcode, BarcodeBuilder>.HtmlAttributes(object)WidgetBuilderBase<Barcode, BarcodeBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<Barcode, BarcodeBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<Barcode, BarcodeBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<Barcode, BarcodeBuilder>.Render()WidgetBuilderBase<Barcode, BarcodeBuilder>.ToHtmlString()WidgetBuilderBase<Barcode, BarcodeBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<Barcode, BarcodeBuilder>.ToClientTemplate()WidgetBuilderBase<Barcode, BarcodeBuilder>.AsModule(bool)WidgetBuilderBase<Barcode, BarcodeBuilder>.ComponentWidgetBuilderBase<Barcode, BarcodeBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the BarcodeBuilder class.

C#
public BarcodeBuilder(Barcode component)
Parameters:componentBarcode

Methods

The background of the barcode area. Any valid CSS color string will work here, including hex and rgb.

C#
public BarcodeBuilder Background(string value)
Parameters:valuestring

The value for Background

Returns:

BarcodeBuilder

Returns the current BarcodeBuilder instance.

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

The border of the barcode area.

C#
public BarcodeBuilder Border(Action<BarcodeBorderSettingsBuilder> configurator)
Parameters:configuratorAction<BarcodeBorderSettingsBuilder>

The BarcodeBorderSettingsBuilder for the border setting.

Returns:

BarcodeBuilder

Returns the current instance of BarcodeBuilder .

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

C#
public BarcodeBuilder Checksum()
Returns:

BarcodeBuilder

Returns the current BarcodeBuilder instance.

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

C#
public BarcodeBuilder Checksum(bool value)
Parameters:valuebool

The value for Checksum

Returns:

BarcodeBuilder

Returns the current BarcodeBuilder instance.

Example:
C#
@(Html.Kendo().Barcode()
.Name("barcode")
.Value("1234567")
.Checksum(true)
)

The color of the bar elements. Any valid CSS color string will work here, including hex and rgb.

C#
public BarcodeBuilder Color(string value)
Parameters:valuestring

The value for Color

Returns:

BarcodeBuilder

Returns the current BarcodeBuilder instance.

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

The symbology used by the Barcode.

C#
public BarcodeBuilder Encoding(BarcodeSymbology encoding)
Parameters:encodingBarcodeSymbology

The configurator for the encoding setting.

Returns:

BarcodeBuilder

Returns the current BarcodeBuilder instance.

Example:
C#
@(Html.Kendo().Barcode()
.Name("barcode")
.Value("10110110")
.Encoding(BarcodeSymbology.Code128)
)

The height of the barcode in pixels. By default the height is 100.

C#
public BarcodeBuilder Height(double value)
Parameters:valuedouble

The value for Height

Returns:

BarcodeBuilder

Returns the current BarcodeBuilder instance.

Example:
C#
@(Html.Kendo().Barcode()
.Name("barcode")
.Value("1234567")
.Height(200)
)

The padding of the barcode.

C#
public BarcodeBuilder Padding(Action<BarcodePaddingSettingsBuilder> configurator)
Parameters:configuratorAction<BarcodePaddingSettingsBuilder>

The BarcodePaddingSettingsBuilder for the padding setting.

Returns:

BarcodeBuilder

Returns the current instance of BarcodeBuilder .

The padding of the Barcode.

C#
public BarcodeBuilder Padding(double padding)
Parameters:paddingdouble

The configurator for the padding setting.

Returns:

BarcodeBuilder

Returns the current BarcodeBuilder instance.

Example:
C#
@(Html.Kendo().Barcode()
.Name("barcode")
.Value("1234567")
.Padding(500)
)

Sets the preferred rendering engine. If it is not supported by the browser, the Barcode will switch to the first available mode.The supported values are: "canvas" - renders the widget as a Canvas element, if available. or "svg" - renders the widget as inline SVG document, if available.

C#
public BarcodeBuilder RenderAs(RenderingMode value)
Parameters:valueRenderingMode

The value for RenderAs

Returns:

BarcodeBuilder

Returns the current BarcodeBuilder instance.

Example:
C#
@(Html.Kendo().Barcode()
.Name("barcode")
.Value("1234567")
.RenderAs(RenderingMode.SVG)
)

Can be set to a JavaScript object which represents the text configuration.

C#
public BarcodeBuilder Text(Action<BarcodeTextSettingsBuilder> configurator)
Parameters:configuratorAction<BarcodeTextSettingsBuilder>

The BarcodeTextSettingsBuilder for the text setting.

Returns:

BarcodeBuilder

Returns the current instance of BarcodeBuilder .

The initial value of the Barcode

C#
public BarcodeBuilder Value(string value)
Parameters:valuestring

The value for Value

Returns:

BarcodeBuilder

Returns the current BarcodeBuilder instance.

Example:
C#
@(Html.Kendo().Barcode()
.Name("barcode")
.Value("1234567")
)

The width of the barcode in pixels. By default the width is 300.

C#
public BarcodeBuilder Width(double value)
Parameters:valuedouble

The value for Width

Returns:

BarcodeBuilder

Returns the current BarcodeBuilder instance.

Example:
C#
@(Html.Kendo().Barcode()
.Name("barcode")
.Value("1234567")
.Width(200)
)