Skip to main content
All docs
V24.1

LookUpEdit.QueryCheckBoxSelectorMemberIsSelected Event

Allows you to select items based on values in the data source field specified by the CheckBoxSelectorMember property.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Events")]
public event EventHandler<PopupCheckBoxSelectorMemberIsSelectedEventArgs> QueryCheckBoxSelectorMemberIsSelected

Event Data

The QueryCheckBoxSelectorMemberIsSelected event's data class is PopupCheckBoxSelectorMemberIsSelectedEventArgs. The following properties provide information specific to this event:

Property Description
IsSelected Gets or sets whether to select the item.
Value Gets the value in the data source.

Remarks

In Multiple Item Selection mode, you can use the CheckBoxSelectorMember property to define the item’s selected state based on the data source object’s property.

Handle the QueryCheckBoxSelectorMemberIsSelected and SetCheckBoxSelectorMemberValue events to convert field values if the specified field is not of the Boolean type:

LookUpEdit - Bind Selection to String Field

public partial class Form1 : DevExpress.XtraEditors.XtraForm {
    public Form1() {
        // ...
        lookUpEdit1.Properties.ValueMember = "ID";
        lookUpEdit1.Properties.DisplayMember = "Name";
        lookUpEdit1.Properties.EditValueType = DevExpress.XtraEditors.Repository.LookUpEditValueType.CSVString;
        lookUpEdit1.Properties.CheckBoxSelectorMember = "Manager";
    }
}
// Selects an item if its "Department.Manager" property is equal to the "Manager.FullName" property.
void lookUpEdit1_QueryCheckBoxSelectorMemberIsSelected(object sender, PopupCheckBoxSelectorMemberIsSelectedEventArgs e) {
    e.IsSelected = ((string)e.Value == manager.FullName);
}
// Posts the "Manager.FullName" property value to the "Department.Manager" property based on selection.
void lookUpEdit1_SetCheckBoxSelectorMemberValue(object sender, PopupCheckBoxSelectorMemberValueEventArgs e) {
    if(e.IsSelected)
        e.Value = manager.FullName;
    else e.Value = null;
}

public class Manager {
    public int ID { get; set; }
    public string FullName { get; set; }
    public string Departments { get; set; }
}
public class Department {
    public int ID { get; set; }
    public string Name { get; set; }
    public string Manager { get; set; }
}
See Also