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

Defines the fluent interface for configuring the Barcode.

Definition

Constructors

C#
public BarcodeBuilder(Barcode component)
Parameters:componentBarcode

Methods

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

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

The value that configures the background color.

Returns:

BarcodeBuilder

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

Configures the options for the border of the Barcode.

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

The action that configures the border.

Returns:

BarcodeBuilder

Example:
C#
@(Html.Kendo().Barcode()
.Name("barcode")
.Value("1234567")
.Border(border =&gt; border.Width(1).Color("#10c4b2").DashType(ChartDashType.Dot))
)

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

C#
public BarcodeBuilder Checksum(bool checksum)
Parameters:checksumbool

The value for the visibility of the checksum digit.

Returns:

BarcodeBuilder

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

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

C#
public BarcodeBuilder Color(string color)
Parameters:colorstring

The configuration of the color setting.

Returns:

BarcodeBuilder

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

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

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

The configuration for the encoding setting.

Returns:

BarcodeBuilder

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

Sets the height of the Barcode area.

C#
public BarcodeBuilder Height(int height)
Parameters:heightint

The value for the height option.

Returns:

BarcodeBuilder

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

Configurator to fine tune the padding of the Barcode.

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

The action that configures the padding options .

Returns:

BarcodeBuilder

Example:
C#
@(Html.Kendo().Barcode()
.Name("barcode")
.Value("1234567")
.Padding(x =&gt; x.Left(100).Top(50).Right(100).Bottom(20))
)

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

C#
public BarcodeBuilder Padding(int padding)
Parameters:paddingint

The configurator for the padding setting.

Returns:

BarcodeBuilder

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

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

C#
public BarcodeBuilder RenderAs(RenderingMode renderAs)
Parameters:renderAsRenderingMode

The preferred rendering engine.

Returns:

BarcodeBuilder

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

Configures options for the text of the Barcode.

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

The action that configures the text settings.

Returns:

BarcodeBuilder

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

Sets the value of the barcode

C#
public BarcodeBuilder Value(int value)
Parameters:valueint

The value that configures the Barcode value.

Returns:

BarcodeBuilder

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

Sets the initial value of the Barcode.

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

The value that configures the Barcode value.

Returns:

BarcodeBuilder

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

Sets the width of the Barcode area.

C#
public BarcodeBuilder Width(int width)
Parameters:widthint

The value for the width option.

Returns:

BarcodeBuilder

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