New to Telerik UI for ASP.NET MVC? 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, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
Parameters:viewContextViewContext

The view context

initializerIJavaScriptInitializer

The JavaScriptInitializer

urlGeneratorIUrlGenerator

The URL generator.

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; }
C#
public float? FloatText { get; }

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.

C#
public string Icon { get; set; }

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 for the Template

C#
public string TemplateHandler { get; set; }

The id for the 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

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

IDictionary<string, object>

Overrides: WidgetBase.Serialize()

Writes the HTML.

C#
protected override void WriteHtml(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

The HtmlTextWriter.

Overrides: WidgetBase.WriteHtml(HtmlTextWriter)

Writes the initialization script.

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

The TextWriter.

Overrides: WidgetBase.WriteInitializationScript(TextWriter)