I'd like to bind boolean data to UltraCombo to synchronize data with ultracombo.
If I check or uncheck checkbox in ultracombo, data changed to true or false.
Also, if I change the data to true or false, checkbox state should be changed.
This is my sample code, but it does not work.
public class Form1 : Form {
public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { List<SelectedString> lst = new List<SelectedString>(); lst.Add(new SelectedString(true, "A")); lst.Add(new SelectedString(false, "B"));
ultraCombo1.DataSource = lst; } }
public class SelectedString { public Boolean Selected { get; set; } public String Value { get; set; }
public SelectedString(Boolean selected, String value) { Selected = selected; Value = value; } }
Hello ,
In order to be able to achieve your goal, your SelectedString class must implements INOtifyPropertychanged interface and also you should set ChekStateMember property of the combo to appropriate column of your data source. Please review following sample and let me know if this is what you are looking for.
Please let me know if you have any further questions.