Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Clicking on Column Header function
Message
De
28/09/2004 02:04:09
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00946470
Message ID:
00946545
Vues:
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

Dmityr,
Download 'Two grid classes' from downloads for sample code. Basically you should check existence of header1 even after removing and add a new one with a new name (not header1). You could also override addcolumn to add your columns (check Message #942362).
In VFP8 there are more than one ways. Simple one I think is to use Member* properties.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform