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
245
XamComboEditor select null
posted

Hi there,

I'm using XamComboEditor inside of XamDataGrid and it's working really smart and fine! Thanks so far.

In this grid, I fill a couple (not all) fields dynamically. I create a field, set some settings and set the EditorStyle to follow special rules. A few a XamComboEditor. With this one I have an issue. I fill the ItemSource and create a alternative binding properly. But the user needs the possiblity to select nothing. For this, I added to the list a null value and this makes some strange behavior. If the user selects in the drop down list this item, the complete drop down box gets clear (only the display strings disappears - not the behind list) and if they move away there back again. If the user clicks on it, the selection is unvalid and other one has been selected.

How can I allow the user to select null (Nothing in vb) properly?

Best regards

Timon

Parents
No Data
Reply
  • 34850
    Offline posted

    Hello Timon,

    When using the XamComboEditor with an alternately-bound Field in the XamDataGrid, you will want to be sure that the Mode property of your alternate binding is set to "TwoWay," otherwise the selection in the XamComboEditor may not work correctly.

    Regarding null selection, I too am running into some strange issues with adding a "null" item to the XamComboEditor in which if this item is added, I am seeing a behavior in which that item is much smaller than the others, and hovering or selecting it will blank out the other elements in the combo box. This is unexpected behavior, and I have asked our engineering staff to examine it further. I will be linking a private support case that I have created for you to the item that I will log internally so that you can track the progress of this issue. This support case has an ID of CAS-188905-N8X9Z2 and I will be sending an initial update to it shortly with further details about this link.

    As for a workaround, I would recommend that instead of adding null to your underlying XamComboEditor, that you add string.Empty, as this is showing up correctly and is not blanking out the drop-down. If string.Empty is not a good value for you, then you can use a Converter on your XamDataGrid Field to convert the string.Empty value to null so that null is the actual stored value in your underlying data item. In doing so, I am personally seeing that the item is a normal size, it is not blanking out the editor, and null is stored on the back-end.

    I have attached a sample project demonstrating this workaround. I hope it helps you.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

    XDGNullValueComboTest.zip
Children
No Data