Information générale
Catégorie:
Gestionnaire d'écran & Écrans
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.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement