﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » custom user control with a devexpress imagecombobox</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 09:06:02 GMT</lastBuildDate><ttl>20</ttl><item><title>custom user control with a devexpress imagecombobox</title><link>http://forum.strataframe.net/FindPost16456.aspx</link><description>I have a table on my db with some png icons to fill a devex imagecombobox like this:&lt;br&gt;
&lt;br&gt;
ID / ICONNAME / IconData (varbinary(max))&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
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:&lt;br&gt;
&lt;br&gt;
        Get&lt;br&gt;
            Return CInt(ComboIcon.EditValue)&lt;br&gt;
        End Get&lt;br&gt;
        Set(ByVal value As Integer)&lt;br&gt;
&lt;br&gt;
            If Me._InValueSet Then&lt;br&gt;
                Exit Property&lt;br&gt;
            Else&lt;br&gt;
                Me._InValueSet = True&lt;br&gt;
            End If&lt;br&gt;
&lt;br&gt;
            value = CInt(ComboIcon.EditValue)&lt;br&gt;
&lt;br&gt;
            Me._InValueSet = False&lt;br&gt;
        End Set&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
Thanks for the great support :)&lt;br&gt;
&lt;br&gt;
- Fabian</description><pubDate>Wed, 21 May 2008 13:28:23 GMT</pubDate><dc:creator>Fabian R Silva, -</dc:creator></item><item><title>RE: custom user control with a devexpress imagecombobox</title><link>http://forum.strataframe.net/FindPost16508.aspx</link><description>LOL....no, no, no....VFP is a bad word around here anymore...so you just stick with it...you are doing great! :)</description><pubDate>Wed, 21 May 2008 13:28:23 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: custom user control with a devexpress imagecombobox</title><link>http://forum.strataframe.net/FindPost16501.aspx</link><description>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:&lt;br&gt;
&lt;br&gt;
thanks again Trent, withtout your help I not sure if I can today encourage to program on .net and leave vfp back :)</description><pubDate>Wed, 21 May 2008 11:31:36 GMT</pubDate><dc:creator>Fabian R Silva, -</dc:creator></item><item><title>RE: custom user control with a devexpress imagecombobox</title><link>http://forum.strataframe.net/FindPost16486.aspx</link><description>More than likely your problem is that you are not calling a "changed" event which notifies the binding of a change in the value of the bound property.&amp;nbsp; Since you have a property called BindableValue, you will want to create a BindableValueChanged event and an OnBindableValueChanged method to call the event.&amp;nbsp; You will then place this in the Set (or anyplace you change the internal value and want to update the bound value).&lt;/P&gt;&lt;P&gt;[codesnippet]Public Event BindableValueChanged as Eventhandler&lt;BR&gt;&lt;BR&gt;Protected Overridable Sub OnBindableValueChanged()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RaiseEvent BindableValueChanged(Me, EventArgs.Empty)&lt;BR&gt;End Sub[/codesnippet]&lt;/P&gt;&lt;P&gt;Next, you will want to call the OnBindableValueChanged method when the value changes within the control:&lt;/P&gt;&lt;P&gt;[codesnippet]Public Property BindableValue As Integer&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return _BindableValue&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set(Byval value As Integer)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _BindableValue = value&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OnBindableValueChanged()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Set&lt;BR&gt;End Property[/codesnippet]</description><pubDate>Wed, 21 May 2008 09:25:03 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: custom user control with a devexpress imagecombobox</title><link>http://forum.strataframe.net/FindPost16458.aspx</link><description>sorry I misstyped something where say " value = CInt(ComboIcon.EditValue)" I have to write&lt;br&gt;
[b]comboIcon.EditValue = Value[/b]&lt;br&gt;
&lt;br&gt;
sorry for this, thinking to write in english I forgive to write correctly the problem :w00t:</description><pubDate>Mon, 19 May 2008 16:02:05 GMT</pubDate><dc:creator>Fabian R Silva, -</dc:creator></item></channel></rss>