Child 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 Maintenence Form with two tabs, On the first tab I show the Parent Record and on the second tab I have  a List View , where I want to show the children. I want the children refreshed each tme the parent changes. I have both Parent and Child business Objects set up.

I have the method (on the ListView)  set as FillByparentPrimaryKey(System.Int32) and PopulateOnFormLoad set to manual.

I reckon I need to call the FillByParentPrimaryKey() somewhere to refresh the children and am wondering where is the best place to put this code. I could be refreshing ,either using the navigation buttons, Adding a new Parent,Deleting a parent or  doing a search etc.

Also, is just calling FillByParentPrimaryKey() sufficient or do I also need to call any Refresh() code

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
Hi Edhy. Many thanks for your detailed response.

I have input code as suggested bu am getting a message on the Requery code;

Dynamically populating the ListView Failed. Could not create and fill the business object of type.....

When I look a t the detail, there seems to be some issue converting a string to a GUID

-------------------  My Code is as follows ------------------------------------------------------------------

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

        {

                 if (this.smA_BO1.Count > 0)

            { e.Parameters[0].Value = this.smA_BO1.PrimaryKeyField.ToString(); }

            else

            { e.Parameters[0].Value = "zahaha"; }

         }

 

private void smA_BO1_Navigated(MicroFour.StrataFrame.Business.NavigatedEventArgs e)

{ this.listView1.Requery();}

-------------------------------------------------------------------------------------

In the Method To Execute.. I am not clear on what GUID refers to. My primary key happens to be a Char(10) field

Am I ciorrect in using a FillByParentPrimaryKey(Guid) here .... not sure what a GUID is ??

Also in code above, not sure if This.SmaBO1.PrimaryKeyField.Tostring() is correct ?

 


Attachments
ListView PopulationSettings.png (143 views, 44.00 KB)
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
The problem is the PrimaryKeyField is the name of the primary key field...not the value. Use the PrimaryKeyFieldValue property or use bo.CurrentRow(bo.PrimaryKeyField). The later will definitely need a conversion to work, not sure on the former...never noticed that property before! Likely it is strong typed though.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search