2012-08-07 16:48 UTC
I am going crazy trying to get my grid to behave as i want it to. I'm sure I'm forgetting something simple and obvious, but for the life of me I can't spot it.
OpenDCL 6.0.2.5 on AutoCAD 2006 SP1 and Windows XP SP3
(defun c:QuickTest()
(command "_OPENDCL")
(if (dcl_Project_Load "QuickTest")
(setq Result (dcl_Form_Show QuickTest_Form1))
)
)
(defun c:QuickTest_Form1_OnInitialize (/)
(while (dcl_Grid_DeleteColumn QuickTest_Form1_Grid1 0))
(dcl_Grid_Clear QuickTest_Form1_Grid1)
(dcl_Control_SetRowHeader QuickTest_Form1_Grid1 T)
(setq dbfieldlist (list "Dwgnumber" "DwgTitle" "Dwgname" "Dwgissue"))
(dcl_Grid_AddColumns QuickTest_Form1_Grid1 (list (list "" 0 20 0) (list "" 0 20 0) (list "DatabaseField" 0 140 0)))
;(dcl_Control_SetColumnStyleList QuickTest_Form1_Grid1 0 1 36)
;(dcl_Control_SetColumnListItems QuickTest_Form1_Grid1 (list nil nil dbfieldlist))
(dcl_Grid_DeleteColumn QuickTest_Form1_Grid1 3)
(dcl_Grid_InsertRow QuickTest_Form1_Grid1 1 "" "" "DwgNumber1")
(setq combodatalist (append (list "Dwgnumber1") dbfieldlist))
(dcl_Grid_SetCellStyle QuickTest_Form1_Grid1 1 2 36)
(dcl_Grid_SetCellDropList QuickTest_Form1_Grid1 1 2 combodatalist)
)
The Form is just a modal dailog box with a grid component only.
If I run it like this it will not set the type to 36. a call to getcelltype will return as 36, but it is not in the actual form. Please educate me as to what I am doing wrong. If I uncoment out the 2 lines above that sets the column default and the coulm default list value it works but I am unable to modify the list to append the current value. any help is greatly appreciated.
OpenDCL 6.0.2.5 on AutoCAD 2006 SP1 and Windows XP SP3
(defun c:QuickTest()
(command "_OPENDCL")
(if (dcl_Project_Load "QuickTest")
(setq Result (dcl_Form_Show QuickTest_Form1))
)
)
(defun c:QuickTest_Form1_OnInitialize (/)
(while (dcl_Grid_DeleteColumn QuickTest_Form1_Grid1 0))
(dcl_Grid_Clear QuickTest_Form1_Grid1)
(dcl_Control_SetRowHeader QuickTest_Form1_Grid1 T)
(setq dbfieldlist (list "Dwgnumber" "DwgTitle" "Dwgname" "Dwgissue"))
(dcl_Grid_AddColumns QuickTest_Form1_Grid1 (list (list "" 0 20 0) (list "" 0 20 0) (list "DatabaseField" 0 140 0)))
;(dcl_Control_SetColumnStyleList QuickTest_Form1_Grid1 0 1 36)
;(dcl_Control_SetColumnListItems QuickTest_Form1_Grid1 (list nil nil dbfieldlist))
(dcl_Grid_DeleteColumn QuickTest_Form1_Grid1 3)
(dcl_Grid_InsertRow QuickTest_Form1_Grid1 1 "" "" "DwgNumber1")
(setq combodatalist (append (list "Dwgnumber1") dbfieldlist))
(dcl_Grid_SetCellStyle QuickTest_Form1_Grid1 1 2 36)
(dcl_Grid_SetCellDropList QuickTest_Form1_Grid1 1 2 combodatalist)
)
The Form is just a modal dailog box with a grid component only.
If I run it like this it will not set the type to 36. a call to getcelltype will return as 36, but it is not in the actual form. Please educate me as to what I am doing wrong. If I uncoment out the 2 lines above that sets the column default and the coulm default list value it works but I am unable to modify the list to append the current value. any help is greatly appreciated.