ComboBox bound to enum value not holding selected index


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have a combo box which is populated at runtime with string values (not from an enum).  It is then bound to an enum value which is the selected index of the combo.  I'm seeing some weird behavior in that I can select an item from the dropdown, but immediately when it loses focus the index returns back to the previously selected item.  It's just like the value i'm selecting isn't "sticking" after the combo loses focus.  I am not handling any events that I can see which are modifying this value at all.  The only thing I could figure is that it's something weird with how I setup the enum since I just changed this to be an enum in the mapper instead of an int.  I thought I did it correctly, but perhaps I could have missed a step somewhere?
Replies
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Oh, I should also mention that this is a DevExpress inherited combo.  Not sure if there's something unique about how those handles binding to an enum value.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Well, you mentioned that you are manually populating the combo.  Have you changed the BindingProperty to Text or whatever value it should actually be binding to.  By default the combos will bind to the Selectedvalue property, so if you are just using this combo to bind to text, you will want to change the BindingProperty to Text or something of that nature instead.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search