Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling sorting in a grid.
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00369438
Message ID:
00369767
Views:
24
>>Hi Joe,
>>
>>We have this method SetOrder for our Grid class. In a header.Click() just invoke this.parent.parent.SetOrder(). It's not necessary to specify parameter.
>>
><snip>
>
> tcControlSource=this.ActiveColumn.ControlSource
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Is this valid in VFP5?

I think so, but I'm not sure. Check if you have ActiveColumn property in a VFP5.0 Grid. If your header caption is always the same, as the field name, you may use in Header.Click() this.parent.parent.SetOrder(this.caption). You may want to programatically create Header class and substitute Header1 with your Header class in run-time. Check Cetin's two grids class example in File section for futher details.
>
>
><snip>
>>>I have a grid set up that is showing fields from a view. I want to be able to sort the grid by clicking the header. I hate
>>>to hard code the field name in each header click method but here is what I have come up with.
>>>
>>>if sys(22) <> 'PARTNO' then
>>> index on partno tag partno
>>>else
>>> set order to partno
>>>endif
>>>thisform.refresh
>>>
>>>The next header would have 'DESCRIPTION' instead of partno.
>>>
>>>I figured by creating the index in the click method I save processing by not creating indexes that will never
>>>get used. Does it make sense to do it this way?
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