Page 1 of 1

Custom field combo box - multiple combo boxes

PostPosted: Thu Aug 18, 2016 5:28 pm
by Atronics
Using the sample custom field combo box: If I require multiple combo boxes, how and where do I include the code for additional combo boxes?

Re: Custom field combo box - multiple combo boxes  Topic is solved

PostPosted: Thu Aug 18, 2016 8:14 pm
by Mike.Sheen
Atronics wrote:Using the sample custom field combo box: If I require multiple combo boxes, how and where do I include the code for additional combo boxes?


The same place, you just add a condition and branch based on the custom field name.

In the the sample I think you're referring to, you'll see this code in the FormatCell method of the CustomFieldPlugin class:

Code: Select all
If CustomField.PluginCustomField.Name = "SampleCombobox" Then
     ...
End If


So, to cater for an additional combo field, just add an Else If:

Code: Select all
If CustomField.PluginCustomField.Name = "SampleCombobox" Then
     ...
Else If CustomField.PluginCustomField.Name = "SampleCombobox2" Then
    ...
End If


Mike