ASPxCheckBoxList.SelectedItems Property
Gets the collection of selected items within the check box list.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Description |
---|---|
SelectedItemCollection | A SelectedItemCollection object that contains the selected items. |
Remarks
Use the SelectedItems
, SelectedIndices, or SelectedValues properties to get information about selected items in code behind.
<dx:ASPxCheckBoxList ID="checkBoxList" runat="server">
<Items>
<dx:ListEditItem Value="1" />
<dx:ListEditItem Value="2" />
<!-- ... -->
</Items>
</dx:ASPxCheckBoxList>
<dx:ASPxButton runat="server" ID="ClickButton" Text="Click" OnClick="ClickButton_Click" />
protected void ClickButton_Click(object sender, EventArgs e)
{
var selectedValues = checkBoxList.SelectedValues;
var selectedItems = checkBoxList.SelectedItems;
var selectedIndices = checkBoxList.SelectedIndices;
// ...
}
If the SelectedItems
property returns null
, make sure that you set the ValueType property to an .NET type that matches the ValueField column type. Otherwise, the editor cannot find the corresponding item because the editor’s ValueType property does not match the item type (String by default).
See Also