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
475
Set UltraComboEditor CheckedListSettings at runtime
posted

I have an UltraComboEditor control in an UltraGrid cell.  This is part of cascading dropdowns.  Depending on the selection of the first dropdown, the second dropdown can select one or multiple items. 

I tried setting the CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox on the second dropdown when an option is selected from the first dropdown, but the checkboxes never appear.  If I set this setting at design time, the checkboxes appear.

Can this property not be set at runtime?  Do I have to do something after the property is changed?

ruleChoiceDropdown.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
ruleChoiceDropdown.CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox;
ruleChoiceDropdown.CheckedListSettings.EditorValueSource = Infragistics.Win.EditorWithComboValueSource.CheckedItems;
ruleChoiceDropdown.SetDataBinding(m_categories, string.Empty);
ruleChoiceDropdown.ValueMember = "CATG_UNIT_NM";
ruleChoiceDropdown.DisplayMember = "CATG_UNIT_NM";

If this is not possible, would creating a separate UltraComboEditor control with checkboxes and changing the EditorComponent of the cell at runtime work?

  • 29105
    Verified Answer
    Offline posted

    Hello, I attached a sample demonstrating how to get this working. Please review it  and let me know if you have any questions.

    WinGrid - Dependent Dropdowns CS.zip

  • 475
    Offline posted

    I was able to change the dropdown to contain checkboxes using this code in the grid's AfterCellListCloseUp event.  However, it is applying the change to ALL cells in that column instead of only the current cell.  This clears the value of the other rows in that column.

    ((UltraComboEditor)e.Cell.Row.Cells[ColKey].EditorComponentResolved).CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox;
    ((UltraComboEditor)e.Cell.Row.Cells[ColKey].EditorComponentResolved).CheckedListSettings.EditorValueSource = Infragistics.Win.EditorWithComboValueSource.CheckedItems;
    ((UltraComboEditor)e.Cell.Row.Cells[ColKey].EditorComponentResolved).CheckedListSettings.ItemCheckArea = Infragistics.Win.ItemCheckArea.CheckBox;