Ideas on how to use a combo for a three state boolean


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I ended up having to use a checkbox. I'll eventually just update the db for these fields to use an int and then setup an enum, which is easy to use with the BO.
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Why not bind your BO to a hidden check box control (since that is what you wanted to use), have the combobox that the client wants manipulate its values, or am I missing something?


Keith Chisarik
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I have several instances of boolean fields that require entry, but that really have no default. I.e. They need to be initially NULL (nothing), then the user must set a value before saving. The users would also like a combo, rather than a checkbox. Sigh...



Ideas on the best way to do this?



My attempts so far all are not working. What I'm using now a enum with three values: NotSet (0), No(1), Yes(2). The field in the BO is set as a Nullable(Of Boolean). The combo uses the enum. I've created a custom bindable field that translates the field from the Nullable(of Boolean) to the enum. I've bound the combo to this custom field. I'm not setting any values in SetDefaultValues event handlers, either at the BO level or the form level. The problems I'm having are:



- When a new record is navigated to, the combo says "No", not "Not Set". "No" is the first value in the combo, event though the combo is setup to NOT sort.

- When I go to save the new record, there is a broken rule that the field isn't set...I don't get this one at all. The combo is bound to a custom field that uses the value of the field. If it is "No", then should be set. I test if the field HasValue. If it does, I set it to Yes or No. If not, it doesn't have a value, it is set to NotSet.

- I have no idea how to handle required fields with this scenario. The custom field will always have a value set, but if the value is the "NotSet" enum, then, well, it isn't set.



Anyway, I'm pretty sure I'm missing something pretty obvious here and I'm hoping somebody can point me in the right direction!



Thanks!
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