CheckedListBox and Binding Properties to Items
I'm curious if there is a simple way to bind properties of a class to individual items of a CheckedListBox. There are several components out there (Telerik/DevExpress) that provide PropertyEditor grids, but I'm looking to do it in a CheckedListBox.

IE:

    public class MyItem
    {
        public bool Property1
        {
            get;
            set;
        }

        public bool Property2
        {
            get;
            set;
        }

        public bool Property3
        {
            get;
            set;
        }
    }

And when adding items to the CheckedListBox, I'd like to have some sort of method that lets me do:

    this.AddCheckListBoxItem("Property A", this.myItem.Property1);
    this.AddCheckListBoxItem("Property B", this.myItem.Property2);
    this.AddCheckListBoxItem("Property C", this.myItem.Property3);

the first parameter being the display name within the CheckedListBox.

Then throughout any changes to the checkstate, the bool values would automatically be updated without further code.

Thanks,

Mark


CheckedListBox and Binding Properties to Items
===

I'm curious if there is a simple way to bind properties of a class to individual items of a CheckedListBox. There are several components out there (Telerik/DevExpress) that provide PropertyEditor grids, but I'm looking to do it in a CheckedListBox.

IE:

    public class MyItem
    {
        public bool Property1
        {
            get;
            set;
        }

        public bool Property2
        {
            get;
            set;
        }

        public bool Property3
        {
            get;
            set;
        }
    }

And when adding items to the CheckedListBox, I'd like to have some sort of method that lets me do:

    this.AddCheckListBoxItem("Property A", this.myItem.Property1);
    this.AddCheckListBoxItem("Property B", this.myItem.Property2);
    this.AddCheckListBoxItem("Property C", this.myItem.Property3);

the first parameter being the display name within the CheckedListBox.

Then throughout any changes to the checkstate, the bool values would automatically be updated without further code.

Thanks,

Mark

