Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem building a grid
Message
From
31/10/2004 14:01:03
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Problem building a grid
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP3
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00956295
Message ID:
00956295
Views:
38
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()
Next
Reply
Map
View

Click here to load this message in the networking platform