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
825
Re: Automatic selection-when losing the focus
posted

Hello,

(Not sure, but i think i have the same issue.
If this isn't the case, then please move this to a new topic.)

I create a xamMultiColumnComboBox:

       <ig:XamMultiColumnComboEditor 

            Name="xamMCCE"
            SelectedItemsResetButtonVisibility="Collapsed"
            AutoGenerateColumns="False"
            DisplayMemberPath="LabelText"
            CustomValueEnteredAction="Allow"
            FilterMode="FilterOnPrimaryColumnOnly" >
            <ig:XamMultiColumnComboEditor.Columns>
                <ig:TextComboColumn Key="Value" />
                <ig:TextComboColumn Key="LabelText" />
            </ig:XamMultiColumnComboEditor.Columns>
        </ig:XamMultiColumnComboEditor>

I create a ComboItem Class:

 public class ComboItem
    {
        public ComboItem()
            : this(nullstring.Empty)
        {
        }
 
        public ComboItem(object value, string labelText)
        {
            Value = value;
            LabelText = labelText;
        }
 
        public object Value { getset; }
        public string LabelText { getset; }
    }

Then fill the MultiColumnComboBox with sample data:

 List<ComboItem> itemList = new List<ComboItem>() {
                new ComboItem(1, "one"),
                new ComboItem(2, "two"),
                new ComboItem("drei""three"),
                new ComboItem(4, "four"),
                new ComboItem("fünf""five"),
                new ComboItem(6, "six"),
                new ComboItem(7, "seven"),
                new ComboItem("acht""eight")
            };
 
            xamMCCE.ItemsSource = itemList;

And set a "custom" ComboItem which is not in the list:

            xamMCCE.SelectedItem = new ComboItem(9, "nine");

When i open the DropDown menu, the FIRST item is selected automatically.
If i leave the ComboBox i.e. with TAB or ENTER, the first item is the new selected item.
What i expect is when i open the DropDown, no other item is selected, because the current selected item is not listed.
When i leave the ComboBox, the "custom" item should still be the selected item. 

I attached an example of this.
Is there a workaround for this issue. When will it be fixed approximateky. And how could i be noticed?

Best regards,
Jochen

P.S.: How is it possible to put "code text" in this thread easily, so that i "looks like" code.

MultiColumnComboTest.zip
  • 35319
    posted

    Hello Jochen,

     

    I am just checking if you require any further assistance on the matter.

  • 35319
    posted

    Hello,

     

    I have received a response from our development team and they have changed the behavior of the XamComboEditor in order to select the focused item when the dropdown is selected and closed. In your scenario this modification will not help you to save the ‘nine’ item because it is not in the ItemsSource of the XamMultiColumnComboEditor. When the focus goes in and then out of the editor, the selected item will be set to null, because loosing focus the control tries to resolve the selected item from the ItemsSource and selects it. This is the design behavior.

     

    A possible solution could be add the item in the itemsSource and to disable it. This way the item will be selectable from code-behind and the end user will not be able to select it himself.

     

    Let me know, if you need any further assistance on this matter.

  • 35319
    posted

    Hello Jochen,

     

    I have logged this behavior with our developers in our tracking system, with an issue ID of 145765. I have also created a support ticket on your behalf with number CAS-80089-JC8R07 in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.

  • 35319
    posted

    Hello Jochen,

     

    I have been looking into your question and the selected item that you have set for the XamMultiComboEditor is not part of its ItemsSource collection. When you open the XamMultiComboEditor’s dropdown, your selected item is not shown in it. The default behavior is when the dropdown is opened, one of the items(selected one or the first one) to be focused. This is why the first item is focused.

     

    Would you please tell me whether you want to have no focused element(the first one), when the set selected item is not a part of the ItemsSource collection ?

     

    Looking forward to hearing from you.