﻿<?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?)  » Maintenance Form / Listview / Sync</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 10:26:54 GMT</lastBuildDate><ttl>20</ttl><item><title>Maintenance Form / Listview / Sync</title><link>http://forum.strataframe.net/FindPost1359.aspx</link><description>I tried to set the listview propertie "PopulationDataSourceSettings" to "Location.CopyDataFrom(MicroFour.StrataFrame.Business.BusinessLayerBase,MicroFour.StrataFrame.Business.BusinessCloneDataType)" but i get the below error when doing so. Now if i select the FillAll Function i created no problem i get the data to show up. What am i doing wrong.&lt;/P&gt;&lt;P&gt;Vince&lt;/P&gt;&lt;P&gt;UIException&lt;BR&gt;&amp;nbsp;Dynamically populating the ListView failed.&amp;nbsp; Could not create and fill the business object of type 'DiscoverSuccess_Business.Location'&lt;BR&gt;TargetInvocationException&lt;BR&gt;&amp;nbsp;Exception has been thrown by the target of an invocation.&lt;BR&gt;NullReferenceException&lt;BR&gt;&amp;nbsp;Object reference not set to an instance of an object.&lt;/P&gt;&lt;P&gt;Source&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : MicroFour StrataFrame UI&lt;/P&gt;&lt;P&gt;Stack Trace: &lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Business.BusinessLayer.CopyDataFrom(BusinessLayerBase BusinessObject, BusinessCloneDataType CopyType)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct&amp;amp; sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.ListView.GetFilledBusinessObject(Object[] Parameters)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.ListView.PopulateListView(Object[] Parameters)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.ListView.InitializeObject()&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.InitializeFormLoadObjects()&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.OnLoad(EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Form.OnCreateControl()&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.CreateControl()&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.WmShowWindow(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ScrollableControl.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ContainerControl.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Form.WmShowWindow(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Form.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;BR&gt;</description><pubDate>Tue, 06 Jun 2006 12:48:55 GMT</pubDate><dc:creator>vblain</dc:creator></item><item><title>RE: Maintenance Form / Listview / Sync</title><link>http://forum.strataframe.net/FindPost1418.aspx</link><description>Glad you found your answer.&amp;nbsp; Let us know if you need anything else.</description><pubDate>Tue, 06 Jun 2006 12:48:55 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Maintenance Form / Listview / Sync</title><link>http://forum.strataframe.net/FindPost1417.aspx</link><description>[quote][b]Ben Chase (06/03/2006)[/b][hr]Hey Vince, &lt;br&gt;
&lt;br&gt;
Basically, when you use a method within the PopulationDataSourceSettings that requires parameters, you have to pass the parameters through either the Requery() method on the list view, or through the ListPopulating event like this:&lt;br&gt;
&lt;br&gt;
Requery():ListView1.Requery(BOContainingRecords, BusinessCloneDataType.ClearAndFillFromCompleteTable)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
ListPopulating event:Private Sub ListView1_ListPopulating(ByVal e As MicroFour.StrataFrame.UI.ListPopulatingEventArgs) Handles ListView1.ListPopulating&lt;br&gt;
e.Parameters(0).Value = BOContainingRecords&lt;br&gt;
e.Parameters(1).Value = BusinessCloneDataType.ClearAndFillFromCompleteTable&lt;br&gt;
End Sub&lt;br&gt;
&lt;br&gt;
When the list populates, it creates it's own instance of the business object type you selected within the PopulationDataSourceSettings and executes the method on it. So, the CopyDataFrom method is going to be called on the temporary business object within the list, copying the records from the business object you want into the temp one. The list is then built from the temp one. So, you have to use one of those 2 methods (but not both) to specify the parameters for the method that is executing.&lt;br&gt;
&lt;br&gt;
As for your second problem, you might change this line:&lt;br&gt;
&lt;br&gt;
Me.Location1.NavigateToPrimaryKey(CType(Me.ListView1.SelectedItems("id").Tag, Integer))&lt;br&gt;
&lt;br&gt;
to this:&lt;br&gt;
&lt;br&gt;
Me.Location1.NavigateToPrimaryKey(CType(Me.ListView1.SelectedItems(0).Tag, Integer))&lt;br&gt;
&lt;br&gt;
I'm not sure what it's going to do when you try to get the selected item with "id". The SelectedItems property is just a collection, so calling SelectedItems(0) just gets the first one within the collection. Give that a shot and let me know how it works.[/quote]&lt;br&gt;
&lt;br&gt;
Hi after reading the help file and going through the sample project and tutorials i think that just using the browse button is much better. Why stay with something that dates back to an old framework that i'm trying to replace anyways :). Thanks for the help on this, i had actually figure my error when thinking that navigating to primary key was basically an array so how would it ever know what the name of the colum is.</description><pubDate>Tue, 06 Jun 2006 12:33:18 GMT</pubDate><dc:creator>vblain</dc:creator></item><item><title>RE: Maintenance Form / Listview / Sync</title><link>http://forum.strataframe.net/FindPost1365.aspx</link><description>Hey Vince, &lt;P&gt;Basically, when you use a method within the PopulationDataSourceSettings that requires parameters, you have to pass the parameters through either the Requery() method on the list view, or through the ListPopulating event like this:&lt;/P&gt;&lt;P&gt;Requery():&lt;/P&gt;ListView1.Requery(BOContainingRecords, BusinessCloneDataType.ClearAndFillFromCompleteTable)&lt;BR&gt;&lt;P&gt;ListPopulating event:&lt;/P&gt;Private Sub ListView1_ListPopulating(ByVal e As MicroFour.StrataFrame.UI.ListPopulatingEventArgs) Handles ListView1.ListPopulating&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;e.Parameters(0).Value = BOContainingRecords&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;e.Parameters(1).Value = BusinessCloneDataType.ClearAndFillFromCompleteTable&lt;BR&gt;End Sub&lt;P&gt;When the list populates, it creates it's own instance of the business object type you selected within the PopulationDataSourceSettings and executes the method on it.&amp;nbsp; So, the CopyDataFrom method is going to be called on the temporary business object within the list, copying the records from the business object you want into the temp one.&amp;nbsp; The list is then built from the temp one.&amp;nbsp; So, you have to use one of those 2 methods (but not both) to specify the parameters for the method that is executing.&lt;/P&gt;&lt;P&gt;As for your second problem, you might change this line:&lt;/P&gt;&lt;P&gt;Me.Location1.NavigateToPrimaryKey(CType(Me.ListView1.SelectedItems("id").Tag, Integer))&lt;/P&gt;&lt;P&gt;to this:&lt;/P&gt;&lt;P&gt;Me.Location1.NavigateToPrimaryKey(CType(Me.ListView1.SelectedItems(0).Tag, Integer))&lt;/P&gt;&lt;P&gt;I'm not sure what it's going to do when you try to get the selected item with "id".&amp;nbsp; The SelectedItems property is just a collection, so calling SelectedItems(0) just gets the first one within the collection.&amp;nbsp; Give that a shot and let me know how it works.</description><pubDate>Sat, 03 Jun 2006 14:24:41 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Maintenance Form / Listview / Sync</title><link>http://forum.strataframe.net/FindPost1360.aspx</link><description>the FillAll function seems to work okay. but now i can't get the list to sync with the business object.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Private&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; ListView1_SelectedIndexChanged(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; sender &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Object&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; e &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; System.EventArgs) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Handles&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; ListView1.SelectedIndexChanged&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; ListView1.SelectedItems.Count &amp;gt; 0 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.Location1.NavigateToPrimaryKey(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CType&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.ListView1.SelectedItems(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"id"&lt;/FONT&gt;&lt;FONT size=2&gt;).Tag, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Integer&lt;/FONT&gt;&lt;FONT size=2&gt;))&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;System.NullReferenceException was unhandled by user code&lt;BR&gt;&amp;nbsp; Message="Object reference not set to an instance of an object."&lt;BR&gt;&amp;nbsp; Source="DiscoverSuccess_WinApp"&lt;BR&gt;&amp;nbsp; StackTrace:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at DiscoverSuccess_WinApp.LocationMaintenance.ListView1_SelectedIndexChanged(Object sender, EventArgs e) in C:\Documents and Settings\Vince\Desktop\Discover_Sln\DiscoverSuccess_WinApp\LocationMaintenance.vb:line 51&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ListView.OnSelectedIndexChanged(EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ListView.WmReflectNotify(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ListView.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;BR&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 02 Jun 2006 18:31:54 GMT</pubDate><dc:creator>vblain</dc:creator></item></channel></rss>