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

ListBox

Class

Definition

Constructors

C#
public ListBox(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
Parameters:viewContextViewContextinitializerIJavaScriptInitializerurlGeneratorIUrlGenerator

Properties

If set to false, the widget will not bind to the data source during initialization. In this case, the data binding will occur when the change event of the data source is fired. By default, the ListBox will bind to the data source that is specified in the configuration.

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

The id of the target ListBox to which items from the source ListBox will be transferred and vice versa. If you have to transfer items from the target ListBox over its toolbar, then you also need to set its connectWith option.

C#
public string ConnectWith { get; set; }
C#
public DataSource DataSource { get; }
C#
public string DataSourceId { get; set; }

The field of the data item that provides the text content of the list items. Based on this field, the widget filters the data source.

C#
public string DataTextField { get; set; }

The field of the data item that provides the value of the widget.

C#
public string DataValueField { get; set; }
C#
public ListBoxDraggableSettings Draggable { get; set; }

Array of id strings which determines the ListBoxes that can drag and drop their items to the current ListBox. The dropSources option describes a one way relationship. If you want a two-way connection, then set the dropSources option on both widgets.

C#
public string[] DropSources { get; set; }

Defines the localization texts for the ListBox. Used primarily for localization.

C#
public ListBoxMessagesSettings Messages { get; set; }

Indicates whether the keyboard navigation is enabled or disabled.

C#
public bool? Navigatable { get; set; }
C#
public ListBoxSelectable? Selectable { get; set; }

Specifies the item template of the ListBox.

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; }

Defines the settings for displaying the toolbar of the ListBox. The toolbar allows you to execute a set of predefined actions.By default, the toolbar is not displayed. If the tools array is populated, then the toolbar and the corresponding tools are displayed.

C#
public ListBoxToolbarSettings Toolbar { get; set; }
C#
public IUrlGenerator UrlGenerator { get; }

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

Overrides: WidgetBase.WriteHtml(HtmlTextWriter)

Writes the initialization script.

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

The writer.

Overrides: WidgetBase.WriteInitializationScript(TextWriter)