mgambone2

How to list field names using checkboxes

Discussion created by mgambone2 on Mar 23, 2012
Latest reply on Mar 29, 2012 by neiletheridge1
Hi,

I'm creating a custom tool implementing IGPFunction2 in C#. How do I create an IGPParameterEdit3 object in ParameterInfo that displays the fields of a feature class in checkboxes so a user can select a field?

I have this code snippet for the feature class:

IArray parameters = new ArrayClass();

//0: input_feature
IGPParameterEdit3 input_feature = new GPParameterClass();
input_feature.Name = "input_feature";
input_feature.DisplayName = "Input Feature";
input_feature.DataType = new DEFeatureClassTypeClass() as IGPDataType;
input_feature.Value = new DEFeatureClass() as IGPValue;
input_feature.ParameterType = esriGPParameterType.esriGPParameterRequired;
input_feature.Direction = esriGPParameterDirection.esriGPParameterDirectionInput;
parameters.Add(input_feature);

//1: field_name (select one from a list of field names)
//TO DO: get the field names from input_feature and display as checkboxes

Appreciate any help.

Outcomes