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
1250
xamComboEditor combobox items
posted

I am trying to iterate the combobox items and it is always null.

Here is what I'm trying to accomplish:

foreach (ComboBoxItem Item in ListEditor.ComboBox.Items)
    {
         Item.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
         if (Item.DesiredSize.Width > Width) Width = Item.DesiredSize.Width;
    }

ListEditor.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
ListEditor.Width = ListEditor.DesiredSize.Width + Width;

Parents
  • 69686
    posted

    The ComboBox will not be null only when the editor is in edit mode, as the XamcomboEditor uses a comboBox when it is not in edit mode. if you execute this code when the editor is not in edit mode, then it would be null. You can access these items through the ItemsProvider or ItemsSource properties of the XamComboEditor

Reply Children