Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Textbox Width Off?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Grid Textbox Width Off?
Miscellaneous
Thread ID:
00507402
Message ID:
00507402
Views:
55
Can anther pair of eyeballs look at this?

On my form INIT, I create a 1-record cursor and set it as the RecordSource in my grid. Then I have a command button with the following code in it. The recordsource changes fine, but when I get to my LayoutRefresh method in my grid class, I only get the first character of the column.
Use  "tablesamp" in 0 shared
With ThisForm.GridGeneral1
	.RecordSource = "tablesamp"
	.Refresh()
	.LayoutRefresh("cProj,The Project")
EndWith
And here is the LayoutRefresh code. First I split the passed parameter on the comma, and take the first part as the column/textbox control source, and take the second as the header. The header shows fine, but not the textbox stuff.
Parameters nLType , cCol1 , cCol2 , cCol3 , cCol4 , cCol5 

This.ColumnCount = 0
If VarType(cCol1) ="C"
	nItemCount = Occurs( "," , cCol1 ) + 1
	Dimension arItems[nItemCount,1]
	aItems = ""
	nLastPos = 1
	For nCnt = 1 to nItemCount
		If nCnt < nItemCount
			arItems[nCnt,1] = SubStr( cCol1 , nLastPos , ;
			( At ( "," , cCol1 , nCnt) -1 ) - nLastPos +1 )
		Else
			arItems[nCnt,1] = SubStr( cCol1 , nLastPos , ;
			( Len ( cCol1 ) - nLastPos ) + 1)
		EndIf
		nLastPos = At( "," , cCol1 , nCnt ) +1
	EndFor
EndIf
This.ColumnCount = This.ColumnCount + 1
With This.Columns(This.ColumnCount)
	.Width = 50
	.Header1.Caption = arItems[2]
	.Header1.FontName = "Tahoma"
	.Header1.FontBold = .t.
	.Header1.FontSize = 8
EndWith
With This.Columns(This.ColumnCount).Text1
	.ControlSource = arItems[1]				
	.FontName = "Tahoma"
	.FontBold = .f.
	.FontSize = 8
	.Width = 50
EndWith

? Chr(9) +Chr(9) +Chr(9) + arItems[1]
? Chr(9) +Chr(9) +Chr(9) + arItems[2]
Help!
Next
Reply
Map
View

Click here to load this message in the networking platform