Skip to main content

Is it possible to create a customize dropdown for custom control properties? I want to achieve something like the built-in DataType properties, but then how can I able to populate the list going to dropdown?

 

 

Control Definition with DataType properties

<DataTypes>
     <DataType>AutoNumber</DataType>
     <DataType>Text</DataType>
     <DataType>Memo</DataType>
 </DataTypes>

 

<Prop ID="DataType" mappable="false" setFunction="SetDataType" friendlyname="Data Type" type="drop" category="Detail" refreshdisplay="true" getDropItemsFunction="getDataTypesForControl" SelectionValue="" SelectionText="" inputlength="255">
 <InitialValue>Text</InitialValue>
</Prop>

Hi,

 

Take a look at this link:

 

http://help.k2.com/onlinehelp/K2smartforms/DevRef/1.0.7/default.htm#K2_smartforms_Custom_Controls.html%3FTocPath%3DCustom%20Controls%7C_____0

 

Its the developer reference guide for modifying or creating controls using code, you should be able to create a customisable dropdown using it. 

 

Regards


Hi,

 

Thanks for reply but what I want to achieve is on how to populate data on dropdown list in the control properties.  As my example above, that XML will populate the dropdown list for data types. But how about if I want to have my own list and populate it on a dropdown? See my attached below. Hopes you get what I want. Developer Reference doesn't provide guide on how to do this.


12001iBA77E9319591DB73.jpg

Looks like there is another option available. I saw this nugget in a control project and thought I would update this thread. The current posted method works, but then saw this approach which looks a bit more out of the box.

 

Snippet

<Prop ID="ControlIconSize" friendlyname="Size" type="drop" category="Detail" refreshdisplay="true" SelectionValue="16|24|32" SelectionText="16 x 16|24 x 24|32 x 32">
      <InitialValue>16</InitialValue>
    </Prop>

 You can see there are two additional attributes to the tag. a SelectionValue and a SelectionText. Both are pipe delimited. Works great! I actually have left both approaches in my own control project just for documentation purposes as both approachs could be viable depending on if you wanted static options or an opportunity to get dynamic options.

 

S. 


Reply