Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid...Grid
Message
De
10/08/1998 11:43:28
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
10/08/1998 11:13:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00125262
Message ID:
00125274
Vues:
15
>Hello everyone!
>
>I'm looking for any suggestion how to make an method on a fly for header in my grid.
>I'm doing grid with variable number of columns (table driven) and for example I need to create sort event on header click, how I can do it.
>Thank you in advance.

You can some modification in the code below :
* Grid.init
for each oColumn in this.columns
    lcField = upper(substr(oColumn.controlsource,;
              rat(".",oColumn.controlsource)+1))
    oColumn.removeobject("header1")
    oColumn.addobject("myMSelHeader")
    for jsx = 1 to fcount(this.recordsource)
        if lcField == field(jsx,this.recordsource)
		oColumn.myMSelHeader.TagName="TAG"+padl(jsx,2,"0")
    	endif
    endfor
    oColumn.myMSelHeader.visible = .t.
endfor

* Custom header
define class myMSelHeader as header
    TagName = ""
	procedure click
		if !empty(this.tagname)
			set order to tag (this.tagname)
		else
			set order to 0	
		endif
		nTempCurrec = recno()			
		this.parent.parent.refresh
		go nTempCurrec
	endproc
enddefine
I use this one with on the fly cursors and index them as "TAG"+padl(fieldnum,2,"0").
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