dcl_Grid_SetCellDropList doesn't work as expected

Started by Juerg W. Menzi, October 10, 2011, 09:18:40 AM

Previous topic - Next topic

Juerg W. Menzi

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

owenwengerd

Try calling SetCellStyle to set the cell style to a dropdown style (or set the default column style in the control properties).
Owen Wengerd (Outside The Box) / ManuSoft

Juerg W. Menzi

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

owenwengerd

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.
Owen Wengerd (Outside The Box) / ManuSoft

Juerg W. Menzi

Thank's a lot Owen, you saved my day :)
Sorry about the late response...

Cheers