I have a XamComboEditor in my XamDataGrid that I've successfully put different options into, and you can change options via the dropdown box, etc etc etc bottom line is that it works.
Unfortunately there is one problem that is really annoying, and I have not been able to find an answer scouring these forums. I have a default value that shows up, "Auto". You can change from this option, and the change stays. Switching back, "auto" then stays.
HOWEVER, from the initial default value "Auto", if you select the combo box as if to change it, but don't select anything... you can then click twice outside the box (one to cancel selection and then again to do something else such as select a record in the grid), "Auto" disappears!!!
In my code, I do not change the value of the currently selected item if the selection is "null", which is what happens in this situation. I'm calling the appropriate RaisePropertyChanged() method, yet the visual combobox still changes :(
Is there any way to stop this from happening? Even repeated calls to RaisePropertyChanged() do not fix this. And as I said, this is only on the very first initial value. Once you've changed the selection everything works as expected. Any thoughts?
Works like a charm, thank you! Do you have a minute to explain to me what this does and why it fixes the problem?
Hello Ryan,
I have been looking into you sample project and I suggest you add the following Setter in your XamComboEditor’s Style in the “SampleView.xaml” file:
<Setter Property="ValuePath" Value="CurrentSelectedOption"/>
Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Hello again,
I took the couple hours today to whip up a sample of what I'm talking about. This is pretty close to what I have in my actual project, minus a couple layers of views haha.
In any case, I uploaded the sample program. Open this up and run it. The defaults for the combo boxes should be "One". Click the combo box as if you were going to change it, but instead of selecting anything click twice elsewhere, such as the value column. This will deselect the combo box and leave the combo box blank!
Try changing the values and then doing this. You will notice that the combo box now stays to whatever you last selected. Weird right?
Thanks for keeping on me about this. Just had to take the time to do it! Sorry to keep this issue open so long!
Cheers,
-Ryan-
I am just wondering did you manage to achieve your goal or you need further assistance on this matter.
Hey Stefan,
I'm sorry for not responding, I have this bookmarked as "todo"... I just haven't gotten the time to go back and look at this yet.
I'll let you know when I do!
Thanks,