<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to list field names using checkboxes in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-list-field-names-using-checkboxes/m-p/650955#M17487</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Marilyn,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Was just attempting to do the same thing myself and came across your post.&amp;nbsp; Try this ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First build a domain of the fields.&amp;nbsp; In my case I wanted to exclude fields like Raster, Blob, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family:Courier New;"&gt;// Field Domain&lt;BR /&gt;IGPFieldDomain fieldDomain = new GPFieldDomainClass();&lt;BR /&gt;fieldDomain.AddType(esriFieldType.esriFieldTypeInteger);&lt;BR /&gt;fieldDomain.AddType(esriFieldType.esriFieldTypeSmallInteger);&lt;BR /&gt;fieldDomain.AddType(esriFieldType.esriFieldTypeSingle);&lt;BR /&gt;fieldDomain.AddType(esriFieldType.esriFieldTypeDouble);&lt;BR /&gt;fieldDomain.AddType(esriFieldType.esriFieldTypeString);&lt;BR /&gt;fieldDomain.AddType(esriFieldType.esriFieldTypeDate);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then set up the parameter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family:courier new;"&gt;// Polyline Fields&lt;BR /&gt;IGPParameterEdit3 polylineFieldParam = new GPParameterClass();&lt;BR /&gt;&lt;BR /&gt;IGPDataType fieldDataType = new FieldTypeClass();&lt;BR /&gt;IGPMultiValue fieldsMultiValue = new GPMultiValueClass();&lt;BR /&gt;fieldsMultiValue.MemberDataType = fieldDataType;&lt;BR /&gt;&lt;BR /&gt;IGPMultiValueType fieldsMultiValueType = new GPMultiValueTypeClass();&lt;BR /&gt;fieldsMultiValueType.MemberDataType = fieldDataType;&lt;BR /&gt;&lt;BR /&gt;polylineFieldParam.DataType = fieldsMultiValueType as IGPDataType;&lt;BR /&gt;polylineFieldParam.Value = fieldsMultiValue as IGPValue;&lt;BR /&gt;polylineFieldParam.Domain = fieldDomain as IGPDomain;&lt;BR /&gt;polylineFieldParam.Direction = esriGPParameterDirection.esriGPParameterDirectionInput;&lt;BR /&gt;polylineFieldParam.DisplayName = "Fields";&lt;BR /&gt;polylineFieldParam.Name = "polyline_fields";&lt;BR /&gt;polylineFieldParam.ParameterType = esriGPParameterType.esriGPParameterTypeRequired;&lt;BR /&gt;polylineFieldParam.AddDependency("polyline_features");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And finally modify the dialog class used to display the parameter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family:courier new;"&gt;// Modify the Control for displaying the fields list (the default is a combo box)&lt;BR /&gt;UID mdFieldListUID = new UIDClass();&lt;BR /&gt;mdFieldListUID.Value = "{C15EC6FA-35EF-4204-90FB-01E7B4DD6862}";&lt;BR /&gt;polylineFieldParam.ControlCLSID = mdFieldListUID;&lt;BR /&gt;&lt;BR /&gt;parameters.Add(polylineFieldParam);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I finally found this information at the following link (see section on ControlCLSID)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Building_a_custom_geoprocessing_function_tool/00010000049w000000/"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Building_a_custom_geoprocessing_function_tool/00010000049w000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Mar 2012 10:24:20 GMT</pubDate>
    <dc:creator>NeilEtheridge</dc:creator>
    <dc:date>2012-03-29T10:24:20Z</dc:date>
    <item>
      <title>How to list field names using checkboxes</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-list-field-names-using-checkboxes/m-p/650952#M17484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have this code snippet for the feature class:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IArray parameters = new ArrayClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//0: input_feature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IGPParameterEdit3 input_feature = new GPParameterClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input_feature.Name = "input_feature";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input_feature.DisplayName = "Input Feature";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input_feature.DataType = new DEFeatureClassTypeClass() as IGPDataType;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input_feature.Value = new DEFeatureClass() as IGPValue;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input_feature.ParameterType = esriGPParameterType.esriGPParameterRequired;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input_feature.Direction = esriGPParameterDirection.esriGPParameterDirectionInput;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;parameters.Add(input_feature);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//1: field_name (select one from a list of field names)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//TO DO: get the field names from input_feature and display as checkboxes&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Appreciate any help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 19:31:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-list-field-names-using-checkboxes/m-p/650952#M17484</guid>
      <dc:creator>MarilynGambone</dc:creator>
      <dc:date>2012-03-23T19:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to list field names using checkboxes</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-list-field-names-using-checkboxes/m-p/650953#M17485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;//TO DO: get the field names from input_feature and display as checkboxes&lt;BR /&gt;&lt;BR /&gt;Appreciate any help.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public static List&amp;lt;string&amp;gt; GetFeatureFields( IFeatureLayer featureLayer ) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;string&amp;gt; fieldList = new List&amp;lt;string&amp;gt;();
&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeatureClass featureClass = featureLayer.FeatureClass;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ( featureClass == null ) return fieldList;
&amp;nbsp;&amp;nbsp;&amp;nbsp; for ( int x = 0; x &amp;lt; featureClass.Fields.FieldCount; x++ ) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IField field = featureClass.Fields.get_Field( x );
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldList.Add( field.Name );
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; return fieldList;
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:36:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-list-field-names-using-checkboxes/m-p/650953#M17485</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2021-12-12T03:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to list field names using checkboxes</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-list-field-names-using-checkboxes/m-p/650954#M17486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the reply.&amp;nbsp; What I need, however, is the same input-behavior as the Dissolve Tool (Data Management) such that when a user enters a feature class in a textbox, the fields of that feature class "pops up" with checkboxes before it.&amp;nbsp; I am not using a Windows Form, however.&amp;nbsp; I'm using the ArcObjects "built-in" window for custom tools (IGPFunction).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems like the only way to get to the ArcObjects window is through ParameterInfo.&amp;nbsp; I don't know what interface to implement to get this checkboxes list.&amp;nbsp; In Windows Form, we can simply drag CheckedListBox control.&amp;nbsp; I don't know what's the equivalent of that in ArcObjects.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 12:32:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-list-field-names-using-checkboxes/m-p/650954#M17486</guid>
      <dc:creator>MarilynGambone</dc:creator>
      <dc:date>2012-03-26T12:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to list field names using checkboxes</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-list-field-names-using-checkboxes/m-p/650955#M17487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Marilyn,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Was just attempting to do the same thing myself and came across your post.&amp;nbsp; Try this ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First build a domain of the fields.&amp;nbsp; In my case I wanted to exclude fields like Raster, Blob, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family:Courier New;"&gt;// Field Domain&lt;BR /&gt;IGPFieldDomain fieldDomain = new GPFieldDomainClass();&lt;BR /&gt;fieldDomain.AddType(esriFieldType.esriFieldTypeInteger);&lt;BR /&gt;fieldDomain.AddType(esriFieldType.esriFieldTypeSmallInteger);&lt;BR /&gt;fieldDomain.AddType(esriFieldType.esriFieldTypeSingle);&lt;BR /&gt;fieldDomain.AddType(esriFieldType.esriFieldTypeDouble);&lt;BR /&gt;fieldDomain.AddType(esriFieldType.esriFieldTypeString);&lt;BR /&gt;fieldDomain.AddType(esriFieldType.esriFieldTypeDate);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then set up the parameter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family:courier new;"&gt;// Polyline Fields&lt;BR /&gt;IGPParameterEdit3 polylineFieldParam = new GPParameterClass();&lt;BR /&gt;&lt;BR /&gt;IGPDataType fieldDataType = new FieldTypeClass();&lt;BR /&gt;IGPMultiValue fieldsMultiValue = new GPMultiValueClass();&lt;BR /&gt;fieldsMultiValue.MemberDataType = fieldDataType;&lt;BR /&gt;&lt;BR /&gt;IGPMultiValueType fieldsMultiValueType = new GPMultiValueTypeClass();&lt;BR /&gt;fieldsMultiValueType.MemberDataType = fieldDataType;&lt;BR /&gt;&lt;BR /&gt;polylineFieldParam.DataType = fieldsMultiValueType as IGPDataType;&lt;BR /&gt;polylineFieldParam.Value = fieldsMultiValue as IGPValue;&lt;BR /&gt;polylineFieldParam.Domain = fieldDomain as IGPDomain;&lt;BR /&gt;polylineFieldParam.Direction = esriGPParameterDirection.esriGPParameterDirectionInput;&lt;BR /&gt;polylineFieldParam.DisplayName = "Fields";&lt;BR /&gt;polylineFieldParam.Name = "polyline_fields";&lt;BR /&gt;polylineFieldParam.ParameterType = esriGPParameterType.esriGPParameterTypeRequired;&lt;BR /&gt;polylineFieldParam.AddDependency("polyline_features");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And finally modify the dialog class used to display the parameter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family:courier new;"&gt;// Modify the Control for displaying the fields list (the default is a combo box)&lt;BR /&gt;UID mdFieldListUID = new UIDClass();&lt;BR /&gt;mdFieldListUID.Value = "{C15EC6FA-35EF-4204-90FB-01E7B4DD6862}";&lt;BR /&gt;polylineFieldParam.ControlCLSID = mdFieldListUID;&lt;BR /&gt;&lt;BR /&gt;parameters.Add(polylineFieldParam);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I finally found this information at the following link (see section on ControlCLSID)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Building_a_custom_geoprocessing_function_tool/00010000049w000000/"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Building_a_custom_geoprocessing_function_tool/00010000049w000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 10:24:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-list-field-names-using-checkboxes/m-p/650955#M17487</guid>
      <dc:creator>NeilEtheridge</dc:creator>
      <dc:date>2012-03-29T10:24:20Z</dc:date>
    </item>
  </channel>
</rss>

