General information
Category:
Forms & Form designer
Tim,
I have had to over come a similar problem and have created what I call 'dynamic column technology'. This technology adds columns to a grid depending on field types at run-time. This means that each column can have a set of functions (such as right-click menu options, header click functionalty, etc.) which are specifically designed for that field type and are instantiated at run-time.
To do this I created a number of column classes (in code) which are added at run time.
In my form I have some code that scans through the fields to be added to the grid and sets library to a specific column class based on the field's type.
The column classes look someting like:
DEFINE CLASS chgSpecialTemplate1 AS COLUMN
Name = "chgSpecialcolumn"
FontSize = 8
FontBold = .F.
ForeColor = RGB(0,0,0)
Width = 120
lDivisor = 7
lColNumber = 0
Sparse = .T.
lFiltered = .F.
cFilterExpression = ""
cAorDIndex = ""
lType = "CHAR"
lcTable = ""
DIMENSION aLatest[1]
lComboFilter = .F.
lNoEdit = .F.
ADD OBJECT header1 AS HEADER WITH ;
FONTBOLD = .F., ;
FONTSIZE = 8, ;
ALIGNMENT = 2, ;
FORECOLOR = RGB(0,0,0), ;
CAPTION = "" , ;
NAME = "Header1", ;
OriginalHeader = ""
ADD OBJECT text1 AS cbOricTextBox WITH ;
NAME = "Text1",;
BORDERSTYLE = 0 , ;
lLatest = .F.
PROCEDURE INIT
.
.
ENDPROC
ENDDEFINE
I hope this helps,
James.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only