<?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: Drag and Drop functionality in ArcGIS Pro SDK in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-and-drop-functionality-in-arcgis-pro-sdk/m-p/1365430#M10953</link>
    <description>&lt;P&gt;&amp;gt;&lt;STRONG&gt;I am unaware how can I access the attribute field of that particular feature class.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Select/Search for the row(s) u want to retrieve from the feature class&lt;/P&gt;&lt;P&gt;2. Loop through the rows in the row cursor retrieving the value(s) from each row using either the name of the field or a field index (retrieved from FindField). FindField is useful for situations where u dont know if the returned rows contains the field u r looking for - in that case it will return "-1" rather than a 0-based field index.&lt;/P&gt;&lt;P&gt;A good place to start learning more is here - this section of the GDB concept doc goes into quite some detail on how to select and search for rows and the pattern to use to retrieve attribute values:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#querying-data" target="_blank"&gt;https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#querying-data&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jan 2024 16:49:24 GMT</pubDate>
    <dc:creator>CharlesMacleod</dc:creator>
    <dc:date>2024-01-02T16:49:24Z</dc:date>
    <item>
      <title>Drag and Drop functionality in ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-and-drop-functionality-in-arcgis-pro-sdk/m-p/1365233#M10945</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;I am trying to build a custom UI for a geoprocessing tool using DockPane.&lt;/P&gt;&lt;P&gt;I am populating a textbox or combo box using drag and drop functionality. By referring to the &lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#drag-and-drop" target="_blank" rel="noopener"&gt;documents&lt;/A&gt; and &lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/DragAndDrop" target="_blank" rel="noopener"&gt;sample&lt;/A&gt; &lt;STRONG&gt;I am able to access the feature class in the binding variable "TOCContent"&lt;/STRONG&gt;. &lt;STRONG&gt;I am unaware how can I access the attribute field of that particular feature class.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Any insights or guidance would be appreciated.&lt;/P&gt;&lt;P&gt;Below is the code copied from ESRI's sample (amended slightly).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public override void OnDrop(DropInfo dropInfo)
 {
  await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =&amp;gt;
 {
  if (dropInfo.HasTOCContent())
  { 
      var layers = dropInfo.GetTOCContentOfType&amp;lt;FeatureLayer&amp;gt;();             
      FeatureLayer featureLayer =layers.FirstOrDefault();
   //  TOCContent = featureLayer.GetPath().ToString();
          TOCContent = featureLayer;
          var featureclass = featureLayer.GetFeatureClass();
          var field = featureclass.GetDefinition().GetFields();
          TableContent= field.findfield();
     }  
 }
Data binding implementation:

   private string _tocContentInfo = "Drag and drop from TOC";
   public string TOCContent
   {
       get { return _tocContentInfo; }
       set
      {
           SetProperty(ref _tocContentInfo, value, () =&amp;gt; TOCContent);
      }
   }&lt;/LI-CODE&gt;&lt;P&gt;Below is a screenshot of my goal.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhijeet&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AbhijeetNandeshwar1_0-1704103332779.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/90236i140824523B2EA2FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AbhijeetNandeshwar1_0-1704103332779.png" alt="AbhijeetNandeshwar1_0-1704103332779.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 14:28:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-and-drop-functionality-in-arcgis-pro-sdk/m-p/1365233#M10945</guid>
      <dc:creator>AbhijeetNandeshwar1</dc:creator>
      <dc:date>2024-01-02T14:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Drag and Drop functionality in ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-and-drop-functionality-in-arcgis-pro-sdk/m-p/1365430#M10953</link>
      <description>&lt;P&gt;&amp;gt;&lt;STRONG&gt;I am unaware how can I access the attribute field of that particular feature class.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Select/Search for the row(s) u want to retrieve from the feature class&lt;/P&gt;&lt;P&gt;2. Loop through the rows in the row cursor retrieving the value(s) from each row using either the name of the field or a field index (retrieved from FindField). FindField is useful for situations where u dont know if the returned rows contains the field u r looking for - in that case it will return "-1" rather than a 0-based field index.&lt;/P&gt;&lt;P&gt;A good place to start learning more is here - this section of the GDB concept doc goes into quite some detail on how to select and search for rows and the pattern to use to retrieve attribute values:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#querying-data" target="_blank"&gt;https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#querying-data&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 16:49:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-and-drop-functionality-in-arcgis-pro-sdk/m-p/1365430#M10953</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2024-01-02T16:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Drag and Drop functionality in ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-and-drop-functionality-in-arcgis-pro-sdk/m-p/1365794#M10970</link>
      <description>&lt;P&gt;Hello Charles,&lt;/P&gt;&lt;P&gt;Thank you for the workflow. I did go through the documentation. I am able to get the list of fields however, I am having trouble with binding the list of fields with the combo box which we have in our dockpane. Our attribute table has 3 fields named ObjectID[0], Shape[1] and elevation[2]. &lt;STRONG&gt;I want to populate my combo box with the elevation fields&lt;/STRONG&gt;. Can you please help me with the workflow or any suggestion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; public override async void OnDrop(DropInfo dropInfo)
 {
      //Summary//
    //Same as above in the post from line number 3 to 11
  //Summary//

            FeatureClassDefinition featureClassDefinition = featureclass.GetDefinition();
           IReadOnlyList&amp;lt;ArcGIS.Core.Data.Field&amp;gt; listOfFields = featureClassDefinition.GetFields();

      }
}
        private FeatureLayer _tocContentInfo;
        public FeatureLayer TOCContent
        {
            get { return _tocContentInfo; }
            set
            {
                SetProperty(ref _tocContentInfo, value, () =&amp;gt; TOCContent);
            }
        }

        public IReadOnlyList&amp;lt;ArcGIS.Core.Data.Field&amp;gt; Fields
        {
            get { return listOfFields; }
        }

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhijeet&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 15:12:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-and-drop-functionality-in-arcgis-pro-sdk/m-p/1365794#M10970</guid>
      <dc:creator>AbhijeetNandeshwar1</dc:creator>
      <dc:date>2024-01-03T15:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Drag and Drop functionality in ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-and-drop-functionality-in-arcgis-pro-sdk/m-p/1365898#M10974</link>
      <description>&lt;P&gt;in the code snippet, I see two potential issues:&lt;/P&gt;&lt;P&gt;1. "Fields" property is defined as List of "Field" - unless u have a data template defined, I would change it to List&amp;lt;string&amp;gt; and store the field _name_ or alias rather than the field object itself.&lt;/P&gt;&lt;P&gt;2. U may need to add a manual property notification event after u change the list of field (names). So something like - NotifyPropertyChanged("Fields") right after listOfFields is updated - this alerts the binding that the list has changed and will refresh the combo box contents.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 17:25:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-and-drop-functionality-in-arcgis-pro-sdk/m-p/1365898#M10974</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2024-01-03T17:25:02Z</dc:date>
    </item>
  </channel>
</rss>

