Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Click Grid control header to sorting the data in column
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00708196
Message ID:
00710746
Vues:
21
>Hi Nadya,
>
>I still beginner of OOP. How do I deploy the code u posted to me. I don't how to call the myHeader class. I need your help again.
>
>TQ.

Hi Vincent,

I added the following method to my form. I call this method from form's init. You can have this method as grid's method and call it from grid Init:
********************************************************************
*  Description.......: AdjustGrid - replaces grid's headers with headers based on class
*  Calling Samples...: 
*  Parameter List....: 
*  Created by........: Nadya Nosonovsky 06/24/2002 09:22:36 AM 
*  Modified by.......: 
********************************************************************
for each oColumn in thisform.pgfView.Page1.grdViewResult.columns
	for each loObject in oColumn.controls
		if lower(loObject.class)="header"
			lcCaption=loObject.caption
			oColumn.removeobject("Header1")
			oColumn.newobject("Header1",'myHeader','myHeader.prg',"",m.lcCaption)
			with oColumn.Header1
			    .name="Header1"
			    .caption=m.lcCaption
			    .fontbold=.t.
			    .alignment=2
			    .lDontChangeOthers = .t.
			    .statusbartext = space(10)+ oColumn.comment
				.tooltiptext = oColumn.comment
				.cTagName = oColumn.tag
			endwith
		endif
	next
next
I set comment for each column in design time and put tag name in Column's tag.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform