Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1635
How to bind boolean data to UltraCombo
posted

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;
}
}

  • 48586
    Verified Answer
    posted

    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.

    133629.zip