Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem building a grid
Message
De
31/10/2004 14:01:03
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Problem building a grid
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP3
Network:
Windows NT
Database:
Visual FoxPro
Divers
Thread ID:
00956295
Message ID:
00956295
Vues:
39
Hello everyone,

I start off with a grid with no columns. The code below is in a method called "SetGrid" that is called by the grid's Init method. The problem I am having is that even though the grid appears to be OK and looks OK, when a cell becomes active, the cell takes on the colour of the background so you cannot see the value in the cell. Also, I cannot TAB between the columns?

If anyone has any idea why this might be happening, I would be very grateful indeed!

Thank you,

Angie
LOCAL nColItem, oColumn, cControlSource, cCaption, nWidth, nColCount, lReadOnly

m.nColItem = 0
m.nColCount = 5

FOR m.nColItem = 1 TO m.nColCount
	THIS.ADDCOLUMN(m.nColItem)
	m.oColumn = EVALUATE('THIS.COLUMN' + TRANSFORM(m.nColItem))
	WITH m.oColumn
		DO case
			CASE m.nColItem == 1
				m.cControlSource = 'v_JobList.cJobNum'
				m.cCaption = 'Job'
				m.nWidth = 48
				m.lReadOnly = .T.
			CASE m.nColItem == 2
				m.cControlSource = 'TTOD(v_joblist.dquoted)'
				m.cCaption = 'Date'
				m.nWidth = 74
				m.lReadOnly = .T.
			CASE m.nColItem == 3
				m.cControlSource = 'v_joblist.ccustcode'
				m.cCaption = 'Code'
				m.nWidth = 45
				m.lReadOnly = .T.
			CASE m.nColItem == 4
				m.cControlSource = 'v_joblist.csubcode'
				m.cCaption = 'Sub'
				m.nWidth = 45
				m.lReadOnly = .T.
			CASE m.nColItem == 5
				m.cControlSource = 'v_joblist.cjobdesc'
				m.cCaption = 'Desc'
				m.nWidth = 200
				m.lReadOnly = .T.
		ENDCASE 

		m.oColumn.CONTROLSOURCE = m.cControlSource
		m.oColumn.ADDOBJECT('myText1', 'Txttextboxcustom')
		m.oColumn.CURRENTCONTROL = 'myText1'
		m.oColumn.Width = m.nWidth
		m.oColumn.ReadOnly = m.lReadOnly
		m.oColumn.Header1.Caption = m.cCaption
		m.oColumn.Header1.Alignment = 2
	ENDWITH
ENDFOR 

THIS.SETALL('FontSize', 8)
THIS.REFRESH()
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform