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
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
Hi Gerard,

I am not aware of a "PrimaryKeyValue" property, but you don't need one, just use the field value like I showed you before in my sample code and the sample application posted.

You are getting the error, because you have a String type PK not a GUID type, so probably if you change the Method to Execute in the ListView Population Settings to "FillByParentPrimaryKey(Object)" may do the trick, I have not used it that way, but if that does not work, you can always either create your own method to populate the listview or even overwrite one of the existing methods to get the data the way you want.



Also another method you can use to populate a listview is the "CopyDataFrom(BusinessLayerBase,BusinessCloneDataType)", I belive that is the one used in the combobox sample I uploaded and it does requred you filling up a BO dropped in your form and the listview will simply copy the data from that BO into its internal BO to populate itself.

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
Gerard,

The Value properties of the event args in the ListPopulating event are Object which will accept a Guid value.  It is not necessary to ToString this value if your PK is in fact a Guid.  This woudl be the first thing that I woudl change.  Secondly, what is the stack trace and exception of the error you are getting?

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