<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Binding to a DevExpress ListBox</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Binding to a DevExpress ListBox</description>
  <pubDate>Wed, 10 Jun 2026 19:12:30 -700</pubDate>
  <lastBuildDate>Tue, 18 Nov 2008 11:34:53 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=999</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Binding to a DevExpress ListBox : Erturkcevik,   Here isan example...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=999&amp;PID=3638#3638</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=398" rel="nofollow">Mark</a><br /><strong>Subject:</strong> 999<br /><strong>Posted:</strong> 18-Nov-2008 at 11:34am<br /><br />Erturkcevik, <DIV>&nbsp;</DIV><DIV>Here is&nbsp;an <EM>example</EM> of how to write a DataBinder for a DevExpress ListBoxControl. Use at your own risk. The actual data binding code can get complicated depending on the objects being bound and what the list box does, so I left that out. </DIV><DIV>&nbsp;</DIV><DIV><table width="99%"><tr><td><pre class="BBcode">&nbsp; public class DevExListBoxDataBinder : ControlDataBinder {</DIV><DIV>&nbsp;&nbsp;&nbsp; public override Type ControlType {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return typeof(BaseListBoxControl); }<BR>&nbsp;&nbsp;&nbsp; }</DIV><DIV>&nbsp;&nbsp;&nbsp; protected override double GetBaseFitness(IDataConverter pConverter) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return pConverter is ListConverter ? UIFitness.ModeratelyHigh : UIFitness.None;<BR>&nbsp;&nbsp;&nbsp; }</DIV><DIV>&nbsp;&nbsp;&nbsp; public override String BindingPropertyName {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return "SelectedValue"; }<BR>&nbsp;&nbsp;&nbsp; }</DIV><DIV>&nbsp;&nbsp;&nbsp; public override void InitializeControl(Control pControl, ViewDescriptor pDescriptor) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; base.InitializeControl(pControl, pDescriptor);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ListConverter converter = pDescriptor.DataConverter as ListConverter;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BaseListBoxControl control = pControl as BaseListBoxControl;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Sorting (if needed) is performed on the list ahead of time<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; control.DataSource = converter.List;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; control.DisplayMember = converter.DisplayMember;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; control.ValueMember = converter.ValueMember;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; }<BR>&nbsp;<BR>&nbsp;// Somewhere during application initialization<BR>&nbsp;void AppInit() {<BR>&nbsp;&nbsp;...<BR>&nbsp;&nbsp;...<BR>&nbsp;&nbsp;ControlBinderMap.Instance.UpdateMap(typeof(DevExListBoxDataBinder));<BR>&nbsp;&nbsp;...<BR>&nbsp;&nbsp;...<BR>&nbsp;}<BR></pre></td></tr></table></DIV><DIV>&nbsp;</DIV><DIV>Best wishes,</DIV><DIV>Mark</DIV>]]>
   </description>
   <pubDate>Tue, 18 Nov 2008 11:34:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=999&amp;PID=3638#3638</guid>
  </item> 
  <item>
   <title>Binding to a DevExpress ListBox : Hi; Please send me example code,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=999&amp;PID=3631#3631</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=45" rel="nofollow">erturkcevik</a><br /><strong>Subject:</strong> 999<br /><strong>Posted:</strong> 14-Nov-2008 at 6:20am<br /><br />Hi;<DIV>Please send me example code, I want know, how working DataBinder using the source of ListBoxDataBinder.cs</DIV><DIV>&nbsp;</DIV><DIV>Best Regards</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 14 Nov 2008 06:20:55 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=999&amp;PID=3631#3631</guid>
  </item> 
  <item>
   <title>Binding to a DevExpress ListBox : Just to follow up on this, I wrote...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=999&amp;PID=3621#3621</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=398" rel="nofollow">Mark</a><br /><strong>Subject:</strong> 999<br /><strong>Posted:</strong> 12-Nov-2008 at 12:48pm<br /><br />Just to follow up on this, I wrote a DataBinder using the source of ListBoxDataBinder.cs as a starting point. I only had to change a few lines of code to get it working. Thanks again.]]>
   </description>
   <pubDate>Wed, 12 Nov 2008 12:48:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=999&amp;PID=3621#3621</guid>
  </item> 
  <item>
   <title>Binding to a DevExpress ListBox : That&amp;#039;s what I needed to know....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=999&amp;PID=3620#3620</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=398" rel="nofollow">Mark</a><br /><strong>Subject:</strong> 999<br /><strong>Posted:</strong> 12-Nov-2008 at 10:21am<br /><br />That's what I needed to know. Thank you David.]]>
   </description>
   <pubDate>Wed, 12 Nov 2008 10:21:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=999&amp;PID=3620#3620</guid>
  </item> 
  <item>
   <title>Binding to a DevExpress ListBox : Mark.  You are correct. There...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=999&amp;PID=3619#3619</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=23" rel="nofollow">davidklitzke</a><br /><strong>Subject:</strong> 999<br /><strong>Posted:</strong> 12-Nov-2008 at 10:09am<br /><br />Mark.<DIV>&nbsp;</DIV><DIV>You are correct.&nbsp; There is no DataBinder for&nbsp;the DevEx ListBox control.</DIV><DIV>&nbsp;</DIV><DIV>Here are some of your options:</DIV><DIV>&nbsp;</DIV><DIV>(1) Use a .NET ListBox</DIV><DIV>&nbsp;</DIV><DIV>(2) Write&nbsp;the DataBinder yourself.&nbsp; If you have a Professional license, you might be able to start with the source for the .NET List&nbsp;Box Data Binder, and modify the source.&nbsp; This might be very easy or very difficult depending upon the complexity of the DevEx Databinding.</DIV>]]>
   </description>
   <pubDate>Wed, 12 Nov 2008 10:09:01 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=999&amp;PID=3619#3619</guid>
  </item> 
  <item>
   <title>Binding to a DevExpress ListBox : I&amp;#039;m in the process of swapping...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=999&amp;PID=3612#3612</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=398" rel="nofollow">Mark</a><br /><strong>Subject:</strong> 999<br /><strong>Posted:</strong> 11-Nov-2008 at 4:20pm<br /><br />I'm in the process of swapping out our <FONT size=2>System.Windows.Forms.</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>ListBox</FONT></FONT> controls&nbsp;with&nbsp;<FONT size=2>DevExpress.XtraEditors.</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>ListBoxControl</FONT></FONT> controls and I've ran into a snag with the databinding. From what I can tell there is no&nbsp;IdeaBlade&nbsp;data binder&nbsp;for the DevExpress ListBoxControl. I searched through the forums and couldn't find any information so I'm writing to ask for advice.<DIV>&nbsp;</DIV><DIV>The form I'm working with has two list box controls on it with some buttons in between that allow the user to move items from one list box to the other. The simplified code for databinding looks like this:<DIV><FONT color=#000000><table width="99%"><tr><td><pre class="BBcode">private void doBinding() {<BR>&nbsp;DevExpress.XtraEditors.ListBoxControl availableFieldsListBox = <BR>&nbsp;&nbsp;new DevExpress.XtraEditors.ListBoxControl();<BR>&nbsp;DevExpress.XtraEditors.ListBoxControl fieldsToClearListBox = <BR>&nbsp;&nbsp;new DevExpress.XtraEditors.ListBoxControl();</FONT></DIV><DIV><FONT color=#000000>&nbsp;BindableList&lt;SomeObject.SomeField&gt;() arrLeft = new BindableList&lt;SomeObject.SomeField&gt;();<BR>&nbsp;BindableList&lt;SomeObject.SomeField&gt;() arrRight = new BindableList&lt;SomeObject.SomeField&gt;();<BR>&nbsp;BindableList&lt;SomeObject.SomeField&gt; fieldList = new BindableList&lt;SomeObject.SomeField&gt;();</FONT></DIV><DIV><FONT color=#000000>&nbsp;ControlBindingManager ctrlBM = new ControlBindingManager(fieldList);</FONT></DIV><DIV><FONT color=#000000>&nbsp;ctrlBM.Descriptors.Add(availableFieldsListBox, "Description", <BR>&nbsp;&nbsp;fieldListConverter(fieldList, arrLeft));<BR>&nbsp;ctrlBM.Descriptors.Add(fieldsToClearListBox, "Description", <BR>&nbsp;&nbsp;fieldListConverter(fieldList, arrRight));<BR>}</FONT></DIV><DIV><FONT color=#000000>private ListConverter fieldListConverter(BindableList&lt;SomeObject.SomeField&gt; pDatasource,<BR>&nbsp; BindableList&lt;SomeObject.SomeField&gt; pArr) {<BR>&nbsp;ListConverter listConverter = new ListConverter(pDatasource, Editability.Optional, <BR>&nbsp;&nbsp;true, "Description", "Code");<BR>&nbsp;listConverter.SetList(pArr);<BR>&nbsp;return listConverter;<BR>}</pre></td></tr></table></FONT></DIV><DIV>The application compiles fine, but when I run it I get the following exception:</DIV></DIV><DIV>&nbsp;</DIV><DIV><FONT color=#0033cc>System.NotSupportedException: Could not locate a suitable binder for a ListBoxControl. Are you missing an assembly reference?</FONT></DIV><DIV>&nbsp;</DIV><DIV>All of our other DevExpress controls bind without errors. So i'm wondering, what do I have to do to get this to work like it did with the Windows.Forms listbox, or is that possible?</DIV><DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>Mark Harmon</DIV>]]>
   </description>
   <pubDate>Tue, 11 Nov 2008 16:20:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=999&amp;PID=3612#3612</guid>
  </item> 
 </channel>
</rss>