custom user control with a devexpress imagecombobox


Author
Message
Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
I have a table on my db with some png icons to fill a devex imagecombobox like this:



ID / ICONNAME / IconData (varbinary(max))





I created a user control that fill a internal imagelist from this table (via a "IconBO") and then add items to a imagecombobox (that can't support a datasource), the value of the items on the combo are the id of the icon, all ok from now.



I see how you implemented the IBusinessBindable and IInitializeBusinessObject on datetimepicker and try to do something similar, I created a property "BindableValue" on mysf user control and on this I put on the get /set:



Get

Return CInt(ComboIcon.EditValue)

End Get

Set(ByVal value As Integer)



If Me._InValueSet Then

Exit Property

Else

Me._InValueSet = True

End If



value = CInt(ComboIcon.EditValue)



Me._InValueSet = False

End Set



the problem is that the combo get the id from the property ok, but when I edit the form, change the value on the combo and try to save it, If I see the "BindableValue" property, this reflect the id (example: 9 (integer)), but on the inmediate window I put trycast(me.Parentform,MyTestForm).PrimaryBusinessObject("IconID") (that is the id of my icon) and I get an "1" (integer) value, I not sure what I made wrong that I cannot set the id from the property automatically.



I not known too much about databinding and sure I made something wrong, but not sure what I have to see or learn to made it to work ok.



Thanks for the great support Smile



- Fabian
Replies
Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
I will try this, thanks Trent for give me some insight about this, I thinked that the event OnBindableValueChanged was used to intercept the change of this for the developer, not to say "the property has changed, change/refresh the BO data" (I thinked that it was automated knowed that when property change, the bind change it automatically) Blush



thanks again Trent, withtout your help I not sure if I can today encourage to program on .net and leave vfp back Smile
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
LOL....no, no, no....VFP is a bad word around here anymore...so you just stick with it...you are doing great! Smile
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