StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
ComboBox bound to enum value not holding selected index
ComboBox bound to enum value not holding selected index
Post Reply
Like
0
ComboBox bound to enum value not holding selected index
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Andria Jensen
Andria Jensen
posted 18 Years Ago
ANSWER
Topic Details
Share Topic
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?
Reply
Like
0
Replies
Andria Jensen
Andria Jensen
posted 18 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 336,
Visits: 497
The BindingProperty is set to SelectedIndex. It works just fine if the BO Mapper is set to return that field as an Int16. It's only when I map it as an enum that I get the behavior I mentioned. As far as setting the BindingProperty to text...I'm not sure how that would work since the enum corresponds to the combo index, not the text. Please let me know if I'm just completely misunderstanding something here.
Reply
Like
0
Trent Taylor
Trent Taylor
posted 18 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
I had just misunderstood your previous post. I thought you were trying to bind to the text. I understand what you are trying to so. The DevExpress combo acts slightly different than other combos so I always have to tinker with them when I want to get them to work in a situation like this. It their SelectedIndex property is Int16 that could be the problem. I don't know if it is or not and would have to look into it deeper to know. If you manually populate the combo (do not use a enum) does the problem persist? For example, just create an ADO.NET DataTable and tie it to the combo.
Dim loTable As New DataTable()
'-- Create your columns
loTable.Columns.Add("desc",GetType(System.String))
loTable.Columns.Add("value",GetType(System.Integer))
'-- Add your rows manually here
'-- Attach the data source to the combo
MyCombo.DisplayMember = "desc"
MyCombo.ValueMember = "value"
MyCOmbo.DataSource = loTable
Reply
Like
0
Andria Jensen
Andria Jensen
posted 18 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 336,
Visits: 497
Actually, I am already populating the combo manually. I have no problems populating the combo. We use a multilingual database and have to populate all combos from it. The only issue is that the BindingField value that is coming out of the BO is not hooking up to the SelectedIndex BindingProperty correctly (or at least that's what it seems like).
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
ComboBox bound to enum value not holding selected index
Andria Jensen
-
18 Years Ago
Oh, I should also mention that this isa DevExpress inherited combo....
Andria Jensen
-
18 Years Ago
Well, you mentioned that you are manually populating the combo. Have...
Trent L. Taylor
-
18 Years Ago
The BindingProperty is set to SelectedIndex. It works just fine if the...
Andria Jensen
-
18 Years Ago
I had just misunderstood your previous post. I thought you were trying...
Trent L. Taylor
-
18 Years Ago
Actually, I am already populating the combo manually. I have no...
Andria Jensen
-
18 Years Ago
Just to clarify, I am attaching a screenshot of the properties for my...
Andria Jensen
-
18 Years Ago
Andrea, I created a sample database and a sample application and it...
Trent L. Taylor
-
18 Years Ago
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search