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
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
Putting in the List2.Requery() has got a little further. Thanks. Now, I can get the grandchildren to display.

I had a porblem displaying the grandchildren as I scrolled up and down the Listview. I played around with the AutonavigateToSelected property  and the Tag field, and this is working now also.... is this yhe purpose of  this propery  ?

The only issue I have right now is how to flush out the Grandchild List, if there are no grandchilden for a partcular son e,g, the following sequence A son with Grandchildren, the next son has no grandchildren. etc. I initially had a if BO1.Count > 0, but then this was not refreshing the Grandchildren , leaving the grandchildren from the previous record. If I took this If BO1.Count out, I got an error message.What I have ended up doing, which works, is as follows:

this.idE_BO1.FillByParentPrimaryKey(0);

if (this.itR_BO1.Count > 0)

{ this.idE_BO1.FillByParentPrimaryKey(this.itR_BO1.ITR_PK); }

this.listView2.Requery();

i.e. I have filled first with a zero value

Is this the best way to do this

 

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/21/2009)
Is this the best way to do this




Yes, you want t run the List2.Requery() all the time so it can do just what is needed, show/remove records from the listview as per request.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




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

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search