Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Clicking on Column Header function
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00946470
Message ID:
00946482
Views:
22
>>I need to change sorting of records when user clicks on a column header of a grid. As far as I know how to do it, you have to replace "Header1" from the column object and replace it with your own custom object. The problem I am having is that it works when grid has no columns and you build it from "scratch."
>>
>>But I am trying to make it work on an existing grid (that is, grid build in the designer). So when I run the following code in the INIT method of the form:
>>
>>
>>for each loColumn in thisform.grid.columns
>>	loColumn.RemoveObject( "Header1" )
>>	loColumn.AddObject( "Header1", "custom_header" )
>>endfor
>>
>>
>>I get error on the line .AddObject. I am using VFP 6.
>>
>>Does VFP 8 grid have functionality that would allow me to make this work on an existing grid (that is, without having to build grid in the INIT method)?
>>
>>Thank you
>
>In VFP 8, you can use BindEvent() to bind the header's click event to code of your choice.

Thank you for your suggestion. To be honest, I was hoping that VFP 8 has some built-in functionality to customize header click event.
I have not yet used BindEvent() and I need to give an estimate to the customer of how many hours it would take to modify the program to add this functionality. And it is hard to estimate time when you don't know anything about the subject matter <g>. But anyway, thank you for your help.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform