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

Badge

Class

Kendo UI Badge component

Definition

Constructors

Initializes a new instance of the Badge class.

C#
public Badge(ViewContext viewContext)
Parameters:viewContextViewContext

Properties

Defines the alignment of the badge

C#
public BadgeAlign? Align { get; set; }

Specifies whether or not to render additional "cutout" border around the badge.

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

Determines whether the textual content should be rendered as an HTML string or it should be encoded.

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

Defines how theme colors are applied to a badge

C#
public BadgeFill? FillMode { get; set; }

The text of the badge. Valid input includes string, number or object with toString method. Default is empty string.

C#
public float? FloatText { get; set; }
C#
public string Icon { get; set; }

Defines the name for an existing icon in a Kendo UI theme or SVG content. The icon is rendered inside the badge by a span.k-icon or span.k-svg-icon element.See web font icons help article for more details on Kendo UI icons.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#
public BadgeIconSettings IconSettings { get; }

If text is a number, it will cap that number.

C#
public double? Max { get; set; }

Defines the position of the badge

C#
public BadgePosition? Position { get; set; }

Defines the shape of the badge

C#
public Rounded? Rounded { get; set; }

Defines the size of the badge

C#
public BadgeSize? Size { get; set; }

The template which renders the content of the badge.

C#
public string Template { get; set; }

The handler that returns the template used for Template

C#
public string TemplateHandler { get; set; }

The id of the script element used for Template

C#
public string TemplateId { get; set; }

The text of the badge. Valid input includes string, number or object with toString method. Default is empty string.

C#
public string Text { get; set; }

Defines the color of the badge

C#
public BadgeColor? ThemeColor { get; set; }

If set to false the badge will not be displayed.

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

Methods

Serializes the component settings to a dictionary.

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

IDictionary<string, object>

A dictionary of settings.

Overrides: WidgetBase.Serialize()

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: WidgetBase.SerializeSettings()

Writes the HTML.

C#
protected override void WriteHtml(TextWriter writer)
Parameters:writerTextWriter

Overrides: WidgetBase.WriteHtml(TextWriter)

Writes the initialization script.

C#
public override void WriteInitializationScript(TextWriter writer)
Parameters:writerTextWriter

The TextWriter.

Overrides: WidgetBase.WriteInitializationScript(TextWriter)