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
255
[UltraComboEditor] Not refreshing checkbox on list
posted

Well, im using an UltraComboEditor with checkbox items. When i have the list of items dropped, i change the checkboxes manually depends of the items that are checked, but i dont see that those items are checked/unchecked until i close and re-open the list, or just scroll down and up again. Seems like the control dont repaint himself when i change that property, but im not sure of that. ¿Any solution? (Tried to refresh / update, but nothing change).

 

This is a bit of the code:

 

private void cmbFamilia_SelectionChanged(object sender, EventArgs e)
        {
            //  If the selected item is the first ("ALL"), i uncheck all other items on the list.
            if (this.cmbFamilia.SelectedItem == this.cmbFamilia.Items[0])
            {
                foreach (ValueListItem item in this.cmbFamilia.Items)
                    if (item != this.cmbFamilia.Items[0])
                        item.CheckState = CheckState.Unchecked;
            }
            else
            {
                Boolean ningunoChecked = true;

                //  Else, if there is any item checked and is not the first, i must uncheck the first one.
                foreach (ValueListItem item in this.cmbFamilia.Items)
                {
                    if (item.CheckState == CheckState.Checked && item != this.cmbFamilia.Items[0])
                    {
                        ningunoChecked = false;
                        this.cmbFamilia.Items[0].CheckState = CheckState.Unchecked;
                    }
                }

                //  If there is none checked, i must check the first.
                if (ningunoChecked)
                    this.cmbFamilia.Items[0].CheckState = CheckState.Checked;
            }
        }