ChildForm with a ListView


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Juan,

Let me see if I understand your situation here:

You need to show items in the ListView for Products that are flagged as Kit, right?

If so you need to do the following in the ListView:

  1. Set the Listview1.PopulateOnFormLoad = Manual
  2. Set the Listview1.PopulateDataSourceSettings to CopyDataFrom(BusinessLayerBase,BusinessCloneDataType)
  3. In the ListPopulating event, set the Parameters as follow:

e.Parameters(0).Value = Me.ProductsBO

e.Parameters(1).Value = MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromDefaultView

Now in the ProductsBO.Navigated event put code to filter the listview data and requery the ListView as needed, something like this:

If Me.ProductsBO.Count > 0 Then

'-- Filter all the order items for the current Order PK

Me.ChildBO.Filter = "KitFlag=" & Me.ChildBO.KitFlag.ToString

End If

' Force the ListView to Requery to Enable/Disable its toolbar

Me.ListView1.Requery()

This is just one approach to give you an idea, of course if the child BO may have a lot of record for the same parent, then instead of using the CopyDataFrom method in the PopulateDataSourceSettings you can create a method in your ChildBO with a parameter to get the data related to the parent with the KitFlag value, and you set those values as parameters in the ListPopulating Event.



Edhy Rijo

Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi

I have a form with a parent BO and several child BO's, in the main form I use several Listview's and child forms to handle tha data and works pretty well, click on the Edit and the ChildForm shows and let me edit the record.

But I need to open a Child that shows a list of records (ListView) not only one record like all other child's. This ChildForm of course is a related to the main form and should shows the records related to the record selected in the main. I follow the same logic that the other children, establish the relationship and open the form, but How should I fill the data in the list?

The scenario is this, the main form is a Products form, the child form will be open if the product is a kit, so the child windows should have a list with products that are part of the kit, so in this form I have a New, Edit and Delete buttons. The problem is how should the ListView PopulationDataSourceSettings shoud go?

Thanks for your help

Smile Everything is possible, just keep trying...

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