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

Avatar

Class

Kendo UI Avatar component

Definition

Constructors

Initializes a new instance of the Avatar class.

C#
public Avatar(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
Parameters:viewContextViewContext

The view context

initializerIJavaScriptInitializer

The JavaScriptInitializer

urlGeneratorIUrlGenerator

The URL generator.

Properties

A text description of the Avatar image. When type="image" is configured this value will be used to populate the alt attribute of the <img> element.

C#
public string Alt { get; set; }

Specifies whether the avatar should render border around its container element. Default is false.

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

Adds additional custom classes to the Avatar container element.

C#
public string ClassName { get; set; }

Specifies the appearance fill style of the Avatar. The available values are "outline", "solid" (default), and null.

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

Specifies an icon name to be used if the avatar type is set to icon. For a list of available icon names, please refer to the Web Font Icons article.

C#
public string Icon { get; set; }

Specifies an image URL or dataURL that would be used to populate the src attribute of the avatar <img> element.

C#
public string Image { get; set; }

Could be one of the predefined shapes available for the widget container: "circle" (default), "small", "medium", "large", or null.

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

The Avatar allows you to set predefined sizes. The available size values are "small", "medium" (default), "large", or null.

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

Sets additional CSS styles to the Avatar container element.

C#
public IDictionary<string, object> Style { get; set; }

Will be used to populated Avatar content when its type is set to text

C#
public string Text { get; set; }

The Avatar allows you to specify predefined theme colors for background of its container. The available themeColor values are: - base - Applies base theme color. - primary (Default) - Applies coloring based on primary theme color. - secondary - Applies coloring based on secondary theme color. - tertiary - Applies coloring based on tertiary theme color. - null - Does not apply theme color class.

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

Could be one of the three predefined types for the widget: icon, image, or text (default).

C#
public AvatarType? Type { 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)