OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: copter on October 15, 2010, 04:50:32 AM

Title: SetCellDropList question
Post by: copter on October 15, 2010, 04:50:32 AM
Hello
I am probably doing something wrong:
I can't populate on intialize a droplist cell in a grid.
I joined a little sample in order to demonstrate the issue.
I tryed with odcl 5 and odcl 6: Same
Thanks for your help.
Title: Re: SetCellDropList question
Post by: owenwengerd on October 15, 2010, 05:28:09 AM
That looks like a bug.  I took a quick look at the code, and it's using the grid control's column default dropdown list and ignoring the list set for the cell.  I'll get that fixed for the next build.
Title: Re: SetCellDropList question
Post by: owenwengerd on October 15, 2010, 05:36:30 AM
After investigating more deeply, I now see that this is working as designed. The cell must have a style set or it uses the column default drop list even if it has its own drop list set. This is done so that settings for a cell can revert back to "inherit from column defaults" mode by setting its style to -1. Your code works if you explicitly set the cell style via (dcl_Grid_SetCellStyle) before adding the list items.
Title: Re: SetCellDropList question
Post by: copter on October 15, 2010, 06:18:47 AM
Thanks Owen It works

Initialy I wanted to modify the defaut drop list with  "dcl_Control_SetColumnListItems"
And it doenst work: (Even if the cells type are defined):
(dcl_Control_SetColumnListItems Test_Form1_Grid1 (list (list "A" "B" "C"))) do nothnig.
That is the reason why I choose to set the list cell by cell.

Any idea ?
Title: Re: SetCellDropList question
Post by: owenwengerd on October 15, 2010, 08:28:49 AM
In your example, the list would be for column 0. Try this instead:
Code (autolisp) Select
(dcl_Control_SetColumnListItems Test_Form1_Grid1 (list nil (list "A" "B" "C")))
Title: Re: SetCellDropList question
Post by: copter on October 18, 2010, 02:05:03 AM
Thanks Owen.
I'll do that