<?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 Sort table based on a given field in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/sort-table-based-on-a-given-field/m-p/1292821#M9851</link>
    <description>&lt;P&gt;How can one programmatically sort a table on a given field? This functionality is achieved in Pro by the user right clicking on a given field and electing to sort descending or ascending on that field. Is this attainable using the pro sdk?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/9021"&gt;@UmaHarano&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/145101"&gt;@CharlesMacleod&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 May 2023 21:01:07 GMT</pubDate>
    <dc:creator>KisakyeM</dc:creator>
    <dc:date>2023-05-24T21:01:07Z</dc:date>
    <item>
      <title>Sort table based on a given field</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/sort-table-based-on-a-given-field/m-p/1292821#M9851</link>
      <description>&lt;P&gt;How can one programmatically sort a table on a given field? This functionality is achieved in Pro by the user right clicking on a given field and electing to sort descending or ascending on that field. Is this attainable using the pro sdk?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/9021"&gt;@UmaHarano&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/145101"&gt;@CharlesMacleod&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 21:01:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/sort-table-based-on-a-given-field/m-p/1292821#M9851</guid>
      <dc:creator>KisakyeM</dc:creator>
      <dc:date>2023-05-24T21:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sort table based on a given field</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/sort-table-based-on-a-given-field/m-p/1292826#M9852</link>
      <description>&lt;P&gt;Starting with Release 3.1, you can use the TableView class as described here:&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Map-Exploration#tableview" target="_blank" rel="noopener"&gt;ProConcepts Map Exploration · Esri/arcgis-pro-sdk Wiki (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and specifically the SortAscending Method:&amp;nbsp;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic10981.html" target="_blank" rel="noopener"&gt;SortAscending Method (TableView)—ArcGIS Pro&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The code would look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var tv = TableView.Active;
if (tv == null)
  return;

// sort the active field descending
if (tv.CanSortDescending)
  tv.SortDescending();


// sort the active field ascending
if (tv.CanSortAscending)
  tv.SortAscending();


// peform a custom sort programmatically
if (tv.CanCustomSort)
{
  // sort fields
  var dict = new Dictionary&amp;lt;string, FieldSortInfo&amp;gt;();
  dict.Add("STATE_NAME", FieldSortInfo.Asc);
  dict.Add("CITY_NAME", FieldSortInfo.Desc);
  await tv.SortAsync(dict);
}


// perform a custom sort via the UI
if (tv.CanCustomSort)
  tv.CustomSort();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 21:49:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/sort-table-based-on-a-given-field/m-p/1292826#M9852</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-05-24T21:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sort table based on a given field</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/sort-table-based-on-a-given-field/m-p/1292842#M9854</link>
      <description>&lt;P&gt;You can also search for the videos from Dev Summit 2023 specifically the session:&lt;/P&gt;&lt;P&gt;"Intermediate Data Visualization Using Table Controls"&lt;/P&gt;&lt;P&gt;You can find the session resources here:&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/tech-sessions" target="_blank"&gt;Tech Sessions · Esri/arcgis-pro-sdk Wiki (github.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 21:44:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/sort-table-based-on-a-given-field/m-p/1292842#M9854</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-05-24T21:44:00Z</dc:date>
    </item>
  </channel>
</rss>

