﻿<?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 » Business Objects and Data Access (How do I?)  » Populating BO from Class that implements IListSource</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 20 Sep 2026 00:04:55 GMT</lastBuildDate><ttl>20</ttl><item><title>Populating BO from Class that implements IListSource</title><link>http://forum.strataframe.net/FindPost8935.aspx</link><description>G'day&lt;P&gt;I'm trying to populate some list boxes from a Class that Implements IListSource. I know that populating a listbox from a BO is easy. I also know that a BO can be populated from an enum. Something like&lt;/P&gt;&lt;P&gt;[codesnippet]Private Sub DeviceTypeEnumBO_ParentFormLoading() Handles Me.ParentFormLoading&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim dt as New Data.DataTable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt = StrataFrame.Tools.Common.BuildTableFromEnum(GetType(DeviceType))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.CopyDataFrom(dt, StrataFrame.Business.BusinessCloneType.ClearAndFillFromCompleteTable)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Dispose()&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;I'm wondering if there is s similar technique for populating a BO from a IListSource Class. I'm sure there is a means of populating the listbox directly through some means, but for consistency I'd like to use a BO in every case if possible.&lt;/P&gt;&lt;P&gt;Any hints would be greatly appreciated&lt;/P&gt;&lt;P&gt;Peter</description><pubDate>Tue, 22 May 2007 09:11:56 GMT</pubDate><dc:creator>Peter Denton</dc:creator></item><item><title>RE: Populating BO from Class that implements IListSource</title><link>http://forum.strataframe.net/FindPost8951.aspx</link><description>[quote]I'm wondering if there is s similar technique for populating a BO from a IListSource Class.[/quote]&lt;/P&gt;&lt;P&gt;No.&amp;nbsp; The population methods on our List controls (combos, lists, ListView) all take the same approach and are designed to work within the integrity of a Business Object (or enum in the case of a combo).&amp;nbsp; Population through an enum or BO when using the SF list controls should suffice most any population needs.&amp;nbsp; We have never seen a need outside of these methods.</description><pubDate>Tue, 22 May 2007 09:11:56 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Populating BO from Class that implements IListSource</title><link>http://forum.strataframe.net/FindPost8949.aspx</link><description>We don't have a method for populating a combo box from an IListSource.&amp;nbsp; However, that functionality already exists within .NET.&amp;nbsp; In order to use the functionality, you set your IListSource object as the .DataSource property on a combo (or ListBox or any other control that inherits from System.Windows.Forms.ListControl).&amp;nbsp; Then, you set the .DisplayMember to the name of the property or column on the object that should be the display and set the .ValueMember to the column or property on the data source that should be the value of each object within the list.&lt;/P&gt;&lt;P&gt;In fact, this is what we do behind the scenes, even with the enum... we just build a DataTable (which implements IListSource) and set the DisplayMember and ValueMember properties after setting the DataSource.</description><pubDate>Tue, 22 May 2007 09:08:50 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>