﻿<?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?)  » BO Problem</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 01:37:33 GMT</lastBuildDate><ttl>20</ttl><item><title>BO Problem</title><link>http://forum.strataframe.net/FindPost1192.aspx</link><description>I've got a bo with FillByMrn(), FillBySSN and FillByLastName methods. Regardless of the search strategy, I want to fill the same ListView. Obviously you can't do this solely by using the properties of the ListView since it specs a single fill method. To deal with this I've done the following:&lt;br&gt;
&lt;br&gt;
        private void buttonMRNSearch_Click(object sender, EventArgs e)&lt;br&gt;
        {&lt;br&gt;
            try&lt;br&gt;
            {&lt;br&gt;
                _CurrentMode = SearchMode.MRN;&lt;br&gt;
                if (MRN.Text.Length != 7) return;&lt;br&gt;
                listView1.PopulationDataSourceSettings.MethodToExecute = "FillByMRN;System.String";&lt;br&gt;
                listView1.PopulationDataSourceSettings.ValueMember = "MRN";&lt;br&gt;
                listView1.Requery();&lt;br&gt;
                //boPatientSearch1.FillByMRN(MRN.Text);&lt;br&gt;
                mSearched = true;&lt;br&gt;
            }&lt;br&gt;
            catch (System.Exception ex)&lt;br&gt;
            {&lt;br&gt;
                ((FormMain)MdiParent).StatusMessage = ex.Message;&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
&lt;br&gt;
Then, on the ListView i've got:&lt;br&gt;
&lt;br&gt;
        private void listView1_ListPopulating(MicroFour.StrataFrame.UI.ListPopulatingEventArgs e)&lt;br&gt;
        {&lt;br&gt;
            MicroFour.StrataFrame.UI.ListPopulatingEventArgs a = (MicroFour.StrataFrame.UI.ListPopulatingEventArgs)e;&lt;br&gt;
            switch (_CurrentMode)&lt;br&gt;
            {&lt;br&gt;
                case SearchMode.LASTFIRST:&lt;br&gt;
                    a.Parameters[0].Value = LastName.Text;&lt;br&gt;
                    a.Parameters[1].Value = FirstName.Text;&lt;br&gt;
                    a.Parameters[2].Value = Gender.Text;&lt;br&gt;
                    break;&lt;br&gt;
                case SearchMode.LASTNAME:&lt;br&gt;
                    a.Parameters[0].Value = LastName.Text;&lt;br&gt;
                    a.Parameters[1].Value = Gender.Text;&lt;br&gt;
                    break;&lt;br&gt;
                case SearchMode.MRN:&lt;br&gt;
                    a.Parameters[0].Value = MRN.Text;&lt;br&gt;
                    break;&lt;br&gt;
                case SearchMode.SSN:&lt;br&gt;
                    a.Parameters[0].Value = SSN.Text;&lt;br&gt;
                    break;&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
&lt;br&gt;
This works BUT there are 2 problems:&lt;br&gt;
1) Even when the ListView is populated with records the bo.CurrentDataTable.Rows.Count = 0&lt;br&gt;
2) The fill method in the bo is never called (i've put breakpoints in the fill methods but they are never reached)&lt;br&gt;
&lt;br&gt;
This has me very confused and I don't know how to proceed.</description><pubDate>Thu, 11 May 2006 15:12:26 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: BO Problem</title><link>http://forum.strataframe.net/FindPost1214.aspx</link><description>Good to hear.</description><pubDate>Thu, 11 May 2006 15:12:26 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: BO Problem</title><link>http://forum.strataframe.net/FindPost1213.aspx</link><description>Based on what you told me about IsListSource, I put the datagridview back and bound it to the instance of the bo that is on the form. That is working fine.</description><pubDate>Thu, 11 May 2006 15:09:43 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: BO Problem</title><link>http://forum.strataframe.net/FindPost1207.aspx</link><description>Well, I don't know what to tell you on the breakpoint not hitting except you might try changing the PopulationDataSourceSettings MethodToExecute to CopyDataFrom and populate the business object that you dropped on the form and use it to copy the data into the business object being used to build the list.</description><pubDate>Thu, 11 May 2006 13:47:54 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: BO Problem</title><link>http://forum.strataframe.net/FindPost1203.aspx</link><description>&lt;br&gt;
&lt;br&gt;
2. The fill methods should be being called. When you set the breakpoint, does the breakpoint symbol have a warning icon on it? &lt;br&gt;
&lt;br&gt;
no&lt;br&gt;
&lt;br&gt;
There are a few reasons that breakpoints might never be reached, but if the list is being populated correctly, then the ListView is definitely executing those methods to gather the data.&lt;br&gt;
&lt;br&gt;
the listmitems are correct.</description><pubDate>Thu, 11 May 2006 11:11:54 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: BO Problem</title><link>http://forum.strataframe.net/FindPost1198.aspx</link><description>1.&amp;nbsp; The ListView creates its own instance of your business object to populate the list; it doesn't use the object on the page, so bo.CurrentDataTable.Rows.Count will equal 0 until you fill it yourself.&amp;nbsp; You could always use the CopyDataFrom method on the PopulationDataSourceSettings.&amp;nbsp; In this case, you would fill the business object on the form, and the ListView would copy the data from that business object into its own business object to populate the list.&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; The fill methods should be being called.&amp;nbsp; When you set the breakpoint, does the breakpoint symbol have a warning icon on it?&amp;nbsp; There are a few reasons that breakpoints might never be reached, but if the list is being populated correctly, then the ListView is definitely executing those methods to gather the data.</description><pubDate>Thu, 11 May 2006 08:53:47 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>