﻿<?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?)  » How Can I Populate my ListView from the Results of a Browse Dialog</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 30 May 2026 10:59:23 GMT</lastBuildDate><ttl>20</ttl><item><title>How Can I Populate my ListView from the Results of a Browse Dialog</title><link>http://forum.strataframe.net/FindPost19980.aspx</link><description>The title says it all. Is there a simple way to let the browse dialog populate my listview?&lt;/P&gt;&lt;P&gt;Thanks!</description><pubDate>Mon, 13 Oct 2008 10:12:53 GMT</pubDate><dc:creator>Marcia G Akins</dc:creator></item><item><title>RE: How Can I Populate my ListView from the Results of a Browse Dialog</title><link>http://forum.strataframe.net/FindPost20045.aspx</link><description>Sounds good :)</description><pubDate>Mon, 13 Oct 2008 10:12:53 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How Can I Populate my ListView from the Results of a Browse Dialog</title><link>http://forum.strataframe.net/FindPost20028.aspx</link><description>[quote][b]Trent L. Taylor (10/10/2008)[/b][hr]The ListView is a lighter control and geared for this very thing.&amp;nbsp; The method that you want to use is the CopyDataFrom (as mentioned earlier).&amp;nbsp; A ListView (or any SF list for that matter) does not keep an instance of the BO that you specify in the PopulateDataSourceSettings property, but rather uses that and the method that you specify to populate the list and then disposes of that object.&amp;nbsp; So in this case, you wouldhave a BO on the form that is the "real"&amp;nbsp;BO that you populate.&amp;nbsp; Then in the ListView you will call the CopyDataFrom method.&amp;nbsp; This same BO would be the BOToPopulate on the BrowseDialog which gets populated on the way back from the Browse.&amp;nbsp; Then finally, the ListPopulating event of the ListView would be handled to supply the parms to the CopyDataFrom method:&lt;P&gt;[codesnippet]e.Parameters(0).Value = MyBOInstance&lt;BR&gt;e.Paramteres(1).Value = BusinessObjectCloneType.ClearAndFillFromDefaultView[/codesnippet][/quote]&lt;P&gt;Hi Trent.&lt;P&gt;&amp;nbsp;&lt;P&gt;Thanks so much for the detailed explanation. That makes everything crystal clear. I will definitely be using the listview in the future</description><pubDate>Sat, 11 Oct 2008 08:03:30 GMT</pubDate><dc:creator>Marcia G Akins</dc:creator></item><item><title>RE: How Can I Populate my ListView from the Results of a Browse Dialog</title><link>http://forum.strataframe.net/FindPost19989.aspx</link><description>The ListView is a lighter control and geared for this very thing.&amp;nbsp; The method that you want to use is the CopyDataFrom (as mentioned earlier).&amp;nbsp; A ListView (or any SF list for that matter) does not keep an instance of the BO that you specify in the PopulateDataSourceSettings property, but rather uses that and the method that you specify to populate the list and then disposes of that object.&amp;nbsp; So in this case, you wouldhave a BO on the form that is the "real"&amp;nbsp;BO that you populate.&amp;nbsp; Then in the ListView you will call the CopyDataFrom method.&amp;nbsp; This same BO would be the BOToPopulate on the BrowseDialog which gets populated on the way back from the Browse.&amp;nbsp; Then finally, the ListPopulating event of the ListView would be handled to supply the parms to the CopyDataFrom method:&lt;/P&gt;&lt;P&gt;[codesnippet]e.Parameters(0).Value = MyBOInstance&lt;BR&gt;e.Paramteres(1).Value = BusinessObjectCloneType.ClearAndFillFromDefaultView[/codesnippet]</description><pubDate>Fri, 10 Oct 2008 09:13:21 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How Can I Populate my ListView from the Results of a Browse Dialog</title><link>http://forum.strataframe.net/FindPost19986.aspx</link><description>[quote][b]Greg McGuffey (10/09/2008)[/b][hr]Of course, if the datagridview is working, you might not want to mess with it, but it is [i]very[/i] easy to populate a listview from a BO...once you figure it out! :D&lt;BR&gt;[/quote]&lt;/P&gt;&lt;P&gt;My philosophy is "if it ain't broke, don't fix it :P&lt;/P&gt;&lt;P&gt;But I will keep your exellent advice handy for the future.&lt;/P&gt;&lt;P&gt;Thanks again.</description><pubDate>Fri, 10 Oct 2008 09:10:13 GMT</pubDate><dc:creator>Marcia G Akins</dc:creator></item><item><title>RE: How Can I Populate my ListView from the Results of a Browse Dialog</title><link>http://forum.strataframe.net/FindPost19985.aspx</link><description>You need to set the MethodToExecute to CopyDataFrom, use the business layer version.&lt;br&gt;
&lt;br&gt;
Setup handler on CurrentTableRefilled on the BO in question, call requery of listview.&lt;br&gt;
&lt;br&gt;
Add handler for the listview's ListPopulating and set the two params needed for CopyDataFrom, the first is the BO the second is an enum indicating how to fill listview from bo.&lt;br&gt;
&lt;br&gt;
Of course, if the datagridview is working, you might not want to mess with it, but it is [i]very[/i] easy to populate a listview from a BO...once you figure it out! :D&lt;br&gt;</description><pubDate>Thu, 09 Oct 2008 16:59:18 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How Can I Populate my ListView from the Results of a Browse Dialog</title><link>http://forum.strataframe.net/FindPost19983.aspx</link><description>Hi Greg.&lt;/P&gt;&lt;P&gt;[quote][b]Greg McGuffey (10/09/2008)[/b][hr]&lt;BR&gt;Hope that heads you in the right direction (or is so wrong somebody smarter will quickly correct me :pinch: )&lt;BR&gt;[/quote]&lt;/P&gt;&lt;P&gt;Just as an FYI, the only reason that I was going to use the listview was that it looked like it might be easier to put an image in the first column. Instead, I went to a DataGridView and added an unbound image column. I put this code in the BrowseDialogClosed() event handler and it worked just fine:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;// Set up the icons for the traffic lights&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (!boViewTracking.IsEmpty)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;foreach&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DataGridViewRow&lt;/FONT&gt;&lt;FONT size=2&gt; loRow &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;in&lt;/FONT&gt;&lt;FONT size=2&gt; grdViewTracking.Rows)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;int&lt;/FONT&gt;&lt;FONT size=2&gt; tlINT = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Convert&lt;/FONT&gt;&lt;FONT size=2&gt;.ToInt32(loRow.Cells[&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"TL"&lt;/FONT&gt;&lt;FONT size=2&gt;].Value.ToString());&lt;/P&gt;&lt;P&gt;loRow.Cells[&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"TrafficLight"&lt;/FONT&gt;&lt;FONT size=2&gt;].Value = imgViewTracking.Images[tlINT];&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 09 Oct 2008 16:09:13 GMT</pubDate><dc:creator>Marcia G Akins</dc:creator></item><item><title>RE: How Can I Populate my ListView from the Results of a Browse Dialog</title><link>http://forum.strataframe.net/FindPost19982.aspx</link><description>[quote][b]Greg McGuffey (10/09/2008)[/b][hr]I'm not super familiar with the BrowseDialog, but I'm guessing you'd drop a BO of the appropriate type on the form, drop a browsedialog on the form, setup the browse dialog to populate that BO when the user selects something, then setup the listview to CopyDataFrom that BO. Finally, handle the BO's CurrentTableRefilled event and requery the listview.&lt;BR&gt;&lt;BR&gt;Hope that heads you in the right direction (or is so wrong somebody smarter will quickly correct me :pinch: )&lt;BR&gt;&lt;BR&gt;[/quote]&lt;/P&gt;&lt;P&gt;The browse dialog is working just fine. I have the ListView set up as bound to the same BO that the browse dialog is populating. But listview does not get populated. The Requery() method wants to call a method on the BO to populate it but that BO has already been poulated by the browse dialog :rolleyes:&amp;nbsp;&amp;nbsp;I just want to tell the listview to go populate itself from the BO that was populated by the browse dialog.&lt;/P&gt;&lt;P&gt;Thanks for trying to help.</description><pubDate>Thu, 09 Oct 2008 15:44:27 GMT</pubDate><dc:creator>Marcia G Akins</dc:creator></item><item><title>RE: How Can I Populate my ListView from the Results of a Browse Dialog</title><link>http://forum.strataframe.net/FindPost19981.aspx</link><description>I'm not super familiar with the BrowseDialog, but I'm guessing you'd drop a BO of the appropriate type on the form, drop a browsedialog on the form, setup the browse dialog to populate that BO when the user selects something, then setup the listview to CopyDataFrom that BO. Finally, handle the BO's CurrentTableRefilled event and requery the listview.&lt;br&gt;
&lt;br&gt;
Hope that heads you in the right direction (or is so wrong somebody smarter will quickly correct me :pinch: )&lt;br&gt;
&lt;br&gt;</description><pubDate>Thu, 09 Oct 2008 15:30:36 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>