Hi,
I was able to list a shapefile's attribute table using a combobox in a custom tool IGPFunction2 implementation by using the following snippet inside the ParameterInfo property. I wanted a checklist or listbox but can't find how to do it.
IArray parameters = new ArrayClass();
//Parameter 1: field_param (List fields in combobox)
IGPParameterEdit3 field_param = new GPParameterClass();
field_param.Name = "field_param";
field_param.DisplayName = "Select Field (with unique values)";
field_param.DataType = new FieldTypeClass() as IGPDataType;
field_param.Value = new FieldClass() as IGPValue;
field_param.AddDependency("input_features"); //input_features DataType should be GPFeatureLayerTypeClass()
field_param.Direction = esriGPParameterDirection.esriGPParameterDirectionInput;
field_param.ParameteryType = esriGPParameterType.esriGPParameterTypeRequired;
parameters.Add(field_param);
When the tool is double-clicked in ArcToolBox, the field_param lists all fields of the input_features (shapefile or feature class). Note the AddDependency property. The fields change depending on the input_features.
Anyone knows how to convert the above into checkboxes (instead of combobox)?