Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order in a grid
Message
 
 
To
25/07/2011 12:12:48
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
01519031
Message ID:
01519080
Views:
81
This message has been marked as the solution to the initial question of the thread.
>>>When a grid contains child records, is there a way to present them in an order different from the index upon which the relationship is based? Say the relationship is based on customerID but we want the child records to be presented in decending order by date.
>>>
>>>Thanks
>>
>>You can use compound index if you'd like to use relationship. The simpler solution will be using CA or parameterized view and requery when the parent CustomerID changes.
>
>Thanks Naomi -
>No luck with a compound index. If the relationship fields are character but the desired sort order is integer, what would the index expression look like? I tried keyfield + str(sortfield) but this didn't work. So I thought I would try the view (no experience there). Do we set up the view as the source for the entire form (both tables) or just for the grid (child table)? I tried it both ways and didn't get very far.

You need a view just for the grid.

The view will be

select * from Child where CustomerID = ?m.CustomerID order by DateFld DESC

For compound index it will be

KeyField + str(2147483647 - IntField) && or just (-1)*IntegerField -- to sort in desc order
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform