Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comboboxes in Grid are blanked
Message
From
12/05/2018 07:26:24
 
 
To
11/05/2018 14:54:50
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01659916
Message ID:
01659946
Views:
50
>>Does a This.Refresh() in the grid's AfterRowColChange() method make any difference?
>>
>>Additionally: you're using a combobox because you want to allow your users to enter values not in the list?
>
>Using This,Refresh() in the grid's AfterRowColChange() method works fine when I move through the same row, but when I change rows, the comboboxes are blanked again.

Ok, Luis, let's try to reproduce the problem.
CREATE CURSOR TestData (FirstCol Character(15), SecondCol Integer, ThirdCol Character(5))

INSERT INTO TestData VALUES ("Hello", 1, "One")
INSERT INTO TestData VALUES ("World", 2, "Two")
INSERT INTO TestData VALUES ("howdy", 3, "Three")

GO TOP

LOCAL TestForm AS Form

m.TestForm = CREATEOBJECT("Form")

m.TestForm.AddObject("TheGrid", "_Grid")

WITH m.TestForm.TheGrid AS Grid

	.ColumnCount = 3
	.RecordSource = "TestData"

	WITH .Columns(3) AS Column
		.RemoveObject("Text1")
		.AddObject("Combo1", "DropDownList")
		.CurrentControl = "Combo1"
		.Sparse = .F.
	ENDWITH

	.Visible = .T.

ENDWITH

m.TestForm.Show(1)

BROWSE

DEFINE CLASS _Grid AS Grid

	* we may need this later on

ENDDEFINE

DEFINE CLASS DropDownList AS ComboBox

	FUNCTION Init

		This.AddItem("One")
		This.AddItem("Two")
		This.AddItem("Three")

		This.Style = 2

	ENDFUNC

ENDDEFINE
Is this working like you're intending?
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform