Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange problem with Grid
Message
From
30/07/2003 15:17:18
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Strange problem with Grid
Miscellaneous
Thread ID:
00815071
Message ID:
00815071
Views:
38
In a Baseclass grid in the Init() event I put some code to bind the grid to the Resize event and/or some code to remove the Header and add a new header based on a specific class.

If I set the properties to show the selected row defining HighlightStyle = 1 and the HighlightForeColor and HighlightBackColor it doesnt shows the Highligted row.

Also tried using the GridHighlighter class and also doesnt semms to show the selected row to be highlighted.

Code of the init event of the grid base class.
LOCAL loParent
WITH THIS

	IF .lHandleContainerResize AND TYPE('.Parent.Name') = 'C'
		loParent = IIF(UPPER(.PARENT.BASECLASS) = 'PAGE', .PARENT.PARENT, ;
			.PARENT)
		BINDEVENT(loParent, 'Resize', THIS, 'HandleContainerResize')
		.nContainerHeight = loParent.HEIGHT
		.nContainerWidth  = loParent.WIDTH
		.nWidth           = .WIDTH
		.nHeight          = .HEIGHT
		.nLeft            = .LEFT
		.nTop             = .TOP
	ENDIF
ENDWITH
****************************************************************************************
*** Control Header's grid to use SET ORDER TO  
****************************************************************************************
* 1) Get the values from actual header to array
* 2) replace with new class
* 3) replace each header with values from array
* aProp_colunas(1,1)->Caption
* aProp_colunas(1,2)->Alignment
* aProp_colunas(1,3)->FontBold
* aProp_colunas(1,4)->WordWrap
* aProp_colunas(1,5)->Forecolor
* aProp_colunas(1,6)->Backcolor

LOCAL ncolunas
ncolunas = THIS.COLUMNCOUNT
DIMENSION aProp_colunas(ncolunas,6)
FOR N = 1 TO ncolunas
	aProp_colunas(N,1) = THIS.COLUMNS(N).HEADER1.CAPTION
	aProp_colunas(N,2) = THIS.COLUMNS(N).HEADER1.ALIGNMENT
	aProp_colunas(N,3) = THIS.COLUMNS(N).HEADER1.FONTBOLD
	aProp_colunas(N,4) = THIS.COLUMNS(N).HEADER1.WORDWRAP
	aProp_colunas(N,5) = THIS.COLUMNS(N).HEADER1.FORECOLOR
	aProp_colunas(N,6) = THIS.COLUMNS(N).HEADER1.BACKCOLOR
ENDFOR


LOCAL oCol
FOR EACH oCol IN THIS.COLUMNS
	IF TYPE('oCol.Header1')='O'
		oCol.REMOVEOBJECT('Header1')
		oCol.NEWOBJECT('Header1','Header_indexa','Header_indexa.prg')
	ENDIF
	oCol = .NULL.
ENDFOR

FOR N = 1 TO ncolunas
	THIS.COLUMNS(N).HEADER1.CAPTION = aProp_colunas(N,1)
	THIS.COLUMNS(N).HEADER1.ALIGNMENT = aProp_colunas(N,2)
	THIS.COLUMNS(N).HEADER1.FONTBOLD = aProp_colunas(N,3)
	THIS.COLUMNS(N).HEADER1.WORDWRAP = aProp_colunas(N,4)
	THIS.COLUMNS(N).HEADER1.FORECOLOR = aProp_colunas(N,5)
	THIS.COLUMNS(N).HEADER1.BACKCOLOR = aProp_colunas(N,6)
ENDFOR
Header indexa.prg just allows to SET ORDER TO TAG name of the column.

Did someone saw the same ?
What I'm missing here ?
Why I dont see the propertie HighlightStyle working when I run the form ?
Any advice is welcome.

Thanks in advance

Peter
Next
Reply
Map
View

Click here to load this message in the networking platform