2009-03-15 22:05 UTC
Hello,
I'm using the possibility of optional ItemData in comboboxes, listboxes, listviews and grids for assigning the item to a recordset in a database using the unique key. This is very interesting if the control has to show sorted items which are unsorted in the list in the AutoLISP program. Using the unique key the item can be identified very quick. For this idea I created a sample to use ItemData but I got some interesting detail I don't know whether tey're bugs or not. I attached the sample.
My questions are:
ComboBox, Sorted=True:
ImageComboBox, Sorted=True:
ListBox, Sorted=True:
GridBox, Sorted=True:
Fred
I'm using the possibility of optional ItemData in comboboxes, listboxes, listviews and grids for assigning the item to a recordset in a database using the unique key. This is very interesting if the control has to show sorted items which are unsorted in the list in the AutoLISP program. Using the unique key the item can be identified very quick. For this idea I created a sample to use ItemData but I got some interesting detail I don't know whether tey're bugs or not. I attached the sample.
My questions are:
ComboBox, Sorted=True:
- If I use dcl_control_setitemdata to assign a list of long it dows work but the numbers are assigned in a wrong order. Because of the property Sorted = True the items are sorted automatically and the order of list of integers does correspond to the new order of the combobox' list. Waht is the best way to assign the ItemDat?
- To avoid the sorting problem I can assign the values line by line and the AddString method returns the rownumber of the newly added string. I thought I can use the SetItemData method to attach the ItemData. This way works very fine for the ListView. But when I click on such an item every item - except the last - return 0 as ItemData value. What did I wrong?
ImageComboBox, Sorted=True:
- Attaching the data works very fine. But the list os not sorted although the property Sorted was set. Did I miss something?
ListBox, Sorted=True:
- If I use dcl_control_setitemdata to assign a list of long it dows work but the numbers are assigned in a wrong order. Because of the property Sorted = True the items are sorted automatically and the order of list of integers does correspond to the new order of the listbox' list.
- To avoid the sorting problem I can assign the values line by line and the AddString method returns the rownumber of the newly added string. I thought I can use the SetItemData method to attach the ItemData. This way works very fine for the ListView. But when I click on such an item every item except the last return 0 as ItemData value.
GridBox, Sorted=True:
- Some items does not show a icon although the method uses a hardcoded icon image?
Fred