OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Juerg W. Menzi on October 10, 2011, 09:18:40 AM

Title: dcl_Grid_SetCellDropList doesn't work as expected
Post by: Juerg W. Menzi on October 10, 2011, 09:18:40 AM
Hi All

It's my first attempt to work with a grid control. Probably I can't see the wood for the trees... ;D

Code (autolisp) Select
(defun c:CC-000_Dialog1_OnInitialize (/)
(dcl_grid_AddRow (CcOdcl "datConnections") (list "" "" "" "" ""))
(dcl_Grid_SetCellDropList (CcOdcl "datConnections") 0 1 '("" "Auslauf" "Einlauf" "Zulauf 1"))
(dcl_Grid_SetCellDropList (CcOdcl "datConnections") 0 2 '("" "DN100" "DN120" "DN150"))
(dcl_Grid_SetCellDropList (CcOdcl "datConnections") 0 3 '("" "PP" "PVC"))
)


Using this code shows only blank dropdowns. BTW, CcOdcl is my function to evaluate the controls.

[ODCL 6.0.2.3]
Cheers
Title: Re: dcl_Grid_SetCellDropList doesn't work as expected
Post by: owenwengerd on October 10, 2011, 09:43:10 AM
Try calling SetCellStyle to set the cell style to a dropdown style (or set the default column style in the control properties).
Title: Re: dcl_Grid_SetCellDropList doesn't work as expected
Post by: Juerg W. Menzi on October 11, 2011, 05:42:21 AM
Hi Owen

Quote from: owenwengerd on October 10, 2011, 09:43:10 AM
Try calling SetCellStyle to set the cell style to a dropdown style (or set the default column style in the control properties).
Thank you, but...
the column style in the control is set to 18, see attachment.

Cheers
Title: Re: dcl_Grid_SetCellDropList doesn't work as expected
Post by: owenwengerd on October 11, 2011, 11:41:15 AM
After checking the code, I remembered that you have to set an explicit cell style anyway. Cells which inherit their style from the column defaults also inherit their dropdown list from the column default.
Title: Re: dcl_Grid_SetCellDropList doesn't work as expected
Post by: Juerg W. Menzi on October 18, 2011, 06:01:33 AM
Thank's a lot Owen, you saved my day :)
Sorry about the late response...

Cheers