Back to Devexpress

ListBoxColumn Class

aspnet-devexpress-dot-web-a26d74c7.md

latest4.6 KB
Original Source

ListBoxColumn Class

Contains settings that define an individual column within list editors.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ListBoxColumn :
    WebColumnBase
vb
Public Class ListBoxColumn
    Inherits WebColumnBase

The following members return ListBoxColumn objects:

Remarks

The ListBoxColumn class implements the functionality of a list column. This functionality is used by list editors such as the ASPxComboBox and ASPxListBox. Columns can be used to visually organize an editor’s list data into a more readable and convenient form. Columns are maintained within a collection of the ListBoxColumnCollection type, which can be accessed via the list editor’s Columns property. An individual column can be accessed within the collection using indexer notation.

An editor’s column can be mapped to a data source’s column by using the ListBoxColumn.FieldName property. A column’s visibility can be controlled via the WebColumnBase.Visible property. Use the WebColumnBase.Caption property to define a column’s caption, and the WebColumnBase.Name property to specify a unique identifier for the column.

Example

aspx
<dx:ASPxListBox ID="lbModels" SelectionMode="CheckColumn" EnableSelectAll="true" DataSourceID="PhoneModels" ValueField="ID" ValueType="System.String" ... >
     <CaptionSettings Position="Top" />
     <Columns>
          <dx:ListBoxColumn FieldName="Name" Caption="Model" Width="100%" />
          <dx:ListBoxColumn FieldName="Price" Width="50px" />
     </Columns>
</dx:ASPxListBox>
<asp:XmlDataSource ID="PhoneModels" DataFile="~/App_Data/PhoneModels.xml" XPath="//Model" runat="server" />
xml
<PhoneModels>
     <Model ID="1" Name="Model1" Price="$100" ... ></Model>
     <Model ID="2" Name="Model2" Price="$100" ... ></Model>
     <Model ID="3" Name="Model3" Price="$150" ... ></Model>
     <Model ID="4" Name="Model4" Price="$200" ... ></Model>
     <Model ID="5" Name="Model5" Price="$200" ... ></Model>
     ...
</PhoneModels>

For a full example, see List Box with Multiple Selection demo.

Implements

IStateManager

IPropertiesOwner

IExpressionsAccessor

Inheritance

Object StateManager CollectionItem WebColumnBase ListBoxColumn BootstrapListBoxField

MVCxListBoxColumn

See Also

ListBoxColumn Members

ASPxComboBox.Columns

ASPxListBox.Columns

List Box

DevExpress.Web Namespace