StrataFrame Forum

How to show details on a Page Tab when activated

http://forum.strataframe.net/Topic30049.aspx

By Ger Cannoll - 6/14/2011

I have a form with a TabControl and a few pages . On the Main Page of the TabControl ,I show details from the Parent (Say Customer) and on one of the Pages, I have a Grid whic shows Transactions from a Child Table (Say Invoices).

Where is the best place to put code (on the Activate of the Page ) so that :

If I have that Transaction Page Visible, the Transactions are refreshed when I navigate to a new  Customer on the Main Page of the tabControl

If I have the Main Page Visible and I navigate to a new customer, I dont want to waste time querying the Transactions (because I may not actually want to see the transactions) , but if I 'click' on the Transactions Page, i want to query the Child Table, and just refesh the grid at that point

(The main reason i dont want to 'Refresh' the children each time I change customer, is because there could be hundreds of transactions, and more oftren than not I will just be traversing the Customers , and looking at the data from the Customer table, and will not be interested in the transactions at all)
By Ivan George Borges - 6/14/2011

Hi Gerard.

Have you tried putting code in the Form's or BO's Navigated method? There you can use the TabControl SelectedIndex and test if you should requery your list.

As for doing it if the user enters the specific TabPage, I guess the TabPage Enter method should do the job too.
By Ger Cannoll - 6/14/2011

Hi Ivan.

That gives me the info I need and I will give it a try. Many tahnks for your help.
By Ivan George Borges - 6/15/2011

You're welcome.

Just come back here during the process if you need.