Skip to main content
A newer version of this page is available. .

Overview - CheckBoxList

CheckBoxList represents a list of check boxes that allows the end user to select them.

Implementation Details

CheckBoxList is realized by the CheckBoxListExtension class. Its instance can be accessed via the ExtensionsFactory.CheckBoxList helper method, which is used to add a CheckBoxList extension to a view. This method’s parameter provides access to the CheckBoxList‘s settings implemented by the CheckBoxListSettings class, allowing you to fully customize the extension.

CheckBoxList‘s client counterpart is represented by the ASPxClientCheckBoxList object.

Declaration

CheckBoxList can be added to a view in the following manner.

View code (ASPX):

<% 
    Html.DevExpress().CheckBoxList(
        settings => {
            settings.Name = "checkBoxList1";
            settings.Properties.ValueField = "ID";
            settings.Properties.TextField = "Name";
            settings.Properties.RepeatLayout = options.RepeatLayout;
            settings.Properties.RepeatDirection = options.RepeatDirection;
            settings.Properties.RepeatColumns = options.RepeatColumns; 
        }
    )
    .BindToXML(MapPath("~/App_Data/ProgLanguages.xml"), "//Language")
    .Render();
%>

View code (Razor):

@Html.DevExpress().CheckBoxList(
    settings =>
    {
        settings.Name = "checkBoxList1";
        settings.Properties.ValueField = "ID";
        settings.Properties.TextField = "Name";
        settings.Properties.RepeatLayout = options.RepeatLayout;
        settings.Properties.RepeatDirection = options.RepeatDirection;
        settings.Properties.RepeatColumns = options.RepeatColumns; 
    }).BindToXML(HttpContext.Current.Server.MapPath("~/App_Data/ProgLanguages.xml"), "//Language").GetHtml()

Note

The Partial View should contain only the extension’s code.

The code result is demonstrated in the image below.

CheckBoxList_view

See Also