Parent-Son-Garndson Listview


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I have a Parent,Son,Grandson which I am trying to display. The Parent is on a Miantemence Form and works fine. I have the Son and Grandson in two ListvIews , side by side. The Son is dispaying fine. When I land on each record of the Son, I want the Grandson records to show, just for the relevant son. Nothing is being displayed on the Grandson list. I have set up as follows: The Foreign  Key for the Grandson is got from the Primary Key on the Son

SonBo.Navigated... This.ListView2.Requery();    //to requery the Grandson ListView

Grandson.ListView.Populating...  e.Parameters[0].value  = this.SonBO["Son_PK"];  //to get Primary key from the Son

Grandson ListView.Properties... PopulateOnFormLoad=Manual  MethodToExecute=FillByParentPrimaryKey(Int32)  (primary key is Numeric)

What am I missing ?

Replies
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Gerard O Carroll (05/17/2009)
... I am just at that learning point on the curve where I reckon if I can get some concrete results on the next few weeks I will have made a lot of progress




Don't worry, you will do just fine, we all have been in the same spot sometime.



The listview is my favorite control, it has been enhanced to do many thing automatically. Read the Listview topic in the "UI Layer -> Controls -> ListView" help file.



I have some free time now, so here is a quick description of how to populate it: The ListView and the ComboBox uses the same type of population, they both have an internal BO to host their items. When you use the Population Type Editor, you can select any method to be executed to fill the internal BO or you can use the BO.CopyDataFrom() method which requires you to have a BO dropped on the form to fill the internal ListView/ComboBox BO, this is the way I prefer to setup ListView since usually you may want to do something else with the data in the ListView and it is easier to manipulate the data in a BO dropped in the form.



Using the BO.CopyDataFrom(BusinessLayerBase, BusinessCloneDataType) method, requires 2 parameters. In the ListView.ListPopulating event you have to assign the values for those 2 parameters, I use VB.NET, but in you case it will look like this:



private void listView1_ListPopulating(MicroFour.StrataFrame.UI.ListPopulatingEventArgs e)

{

e.Parameters[0].Value = this.oR_BO1;

e.Parameters[1].Value = MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromDefaultView;

}



This way, when you call the ListView.Requery() it will copy the data from the BO assigned in Parameters[0] with the required BusinessCloseDataType that you use, in most cases "ClearAndFillFromDefaultView".



Also pay attention to the "StrataFrame: User Interface Automation" properties you can use, in your case for the "Transactions" listview I used the "BusinessObject" and the "AutoNavigateToSelectedRecord" properties, this will have the effect that when you select any record in the ListView it will move the record pointer in the BO "oR_BO1" and trigger the oR_BO1.Navigated() event which will then requery the "Transactions Details" listview which has been in the same way as the "Transaction" listview.



Hope this give you and others a clear view of how the ListView/ComboBox population works. Check the references in the help file and also take a look at the StrataFlix sample which make use of the ListView and ComboBox in its own way. Also keep in mind that this is just one way to populate these controls, SF provide us with a great flexibility on how to populate these controls which you will find out once you get more familiar with the framework.


Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Edhy, thanks for your detailed explanations and help.  I know that Gerard as well as other developers that may run into this into the future will greatly appreciate your efforts!

Gerard, hang in there.  You are making progress each week.  Before long this will all be second-hand! Wink

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ger Cannoll - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Ger Cannoll - 17 Years Ago
             Hi Gerard,
Make sure the instance of...
Edhy Rijo - 17 Years Ago
Ger Cannoll - 17 Years Ago
Edhy Rijo - 17 Years Ago
Ger Cannoll - 17 Years Ago
Ger Cannoll - 17 Years Ago
Edhy Rijo - 17 Years Ago
Ger Cannoll - 17 Years Ago
Edhy Rijo - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Ger Cannoll - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Ger Cannoll - 17 Years Ago
Edhy Rijo - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search