<?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 UniqueValueRendererDefinition reversed order in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/uniquevaluerendererdefinition-reversed-order/m-p/1606162#M12835</link>
    <description>&lt;P&gt;Hello. I am trying to create a uniquevaluerender on a date field.&amp;nbsp; the code below works just fine however the final product is always sorted with the newest date on the bottom, I need it the other way around.&amp;nbsp; This is what it is creating.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonathanDewalt_0-1744740381900.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/130271iA47E8321EAF654E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JonathanDewalt_0-1744740381900.png" alt="JonathanDewalt_0-1744740381900.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this is what i need.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonathanDewalt_1-1744740461648.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/130272iDA21303B8DCCBAE9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JonathanDewalt_1-1744740461648.png" alt="JonathanDewalt_1-1744740461648.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It doesn't seem to matter what order the records are in the featureclass, same results.&amp;nbsp; &amp;nbsp;Any suggestions on how to sort the uniqurenderer in descending order?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;await QueuedTask.Run(async () =&amp;gt;&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;StyleProjectItem style = Project.Current.GetItems&amp;lt;StyleProjectItem&amp;gt;().FirstOrDefault(s =&amp;gt; s.Name == "ColorBrewer Schemes (RGB)");&lt;BR /&gt;if (style == null) return;&lt;BR /&gt;var colorRampList = await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;style.SearchColorRamps("Yellow-Orange-Red (Continuous)"));&lt;BR /&gt;if (colorRampList == null || colorRampList.Count == 0) return;&lt;BR /&gt;CIMColorRamp cimColorRamp = null;&lt;BR /&gt;CIMRenderer renderer = null;&lt;/P&gt;&lt;P&gt;var fields = new List&amp;lt;string&amp;gt; { rmg.AlbertaWildfireTools.Core.Models.AlbertaSchema.IncidentFields.Default(AlbertaWildfireTools.Core.Models.AlbertaSchema.IncidentFields.FieldNames.field_FirProgressionProgDate )};&lt;/P&gt;&lt;P&gt;await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;{&lt;BR /&gt;cimColorRamp = colorRampList[0].ColorRamp;&lt;BR /&gt;var rendererDef = new UniqueValueRendererDefinition(fields, null, cimColorRamp,null,false);&lt;BR /&gt;&lt;BR /&gt;renderer = featureLayer?.CreateRenderer(rendererDef);&lt;BR /&gt;&lt;BR /&gt;featureLayer?.SetRenderer(renderer);&lt;BR /&gt;&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;});&lt;/P&gt;</description>
    <pubDate>Tue, 15 Apr 2025 18:10:01 GMT</pubDate>
    <dc:creator>JonathanDewalt</dc:creator>
    <dc:date>2025-04-15T18:10:01Z</dc:date>
    <item>
      <title>UniqueValueRendererDefinition reversed order</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/uniquevaluerendererdefinition-reversed-order/m-p/1606162#M12835</link>
      <description>&lt;P&gt;Hello. I am trying to create a uniquevaluerender on a date field.&amp;nbsp; the code below works just fine however the final product is always sorted with the newest date on the bottom, I need it the other way around.&amp;nbsp; This is what it is creating.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonathanDewalt_0-1744740381900.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/130271iA47E8321EAF654E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JonathanDewalt_0-1744740381900.png" alt="JonathanDewalt_0-1744740381900.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this is what i need.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonathanDewalt_1-1744740461648.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/130272iDA21303B8DCCBAE9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JonathanDewalt_1-1744740461648.png" alt="JonathanDewalt_1-1744740461648.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It doesn't seem to matter what order the records are in the featureclass, same results.&amp;nbsp; &amp;nbsp;Any suggestions on how to sort the uniqurenderer in descending order?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;await QueuedTask.Run(async () =&amp;gt;&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;StyleProjectItem style = Project.Current.GetItems&amp;lt;StyleProjectItem&amp;gt;().FirstOrDefault(s =&amp;gt; s.Name == "ColorBrewer Schemes (RGB)");&lt;BR /&gt;if (style == null) return;&lt;BR /&gt;var colorRampList = await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;style.SearchColorRamps("Yellow-Orange-Red (Continuous)"));&lt;BR /&gt;if (colorRampList == null || colorRampList.Count == 0) return;&lt;BR /&gt;CIMColorRamp cimColorRamp = null;&lt;BR /&gt;CIMRenderer renderer = null;&lt;/P&gt;&lt;P&gt;var fields = new List&amp;lt;string&amp;gt; { rmg.AlbertaWildfireTools.Core.Models.AlbertaSchema.IncidentFields.Default(AlbertaWildfireTools.Core.Models.AlbertaSchema.IncidentFields.FieldNames.field_FirProgressionProgDate )};&lt;/P&gt;&lt;P&gt;await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;{&lt;BR /&gt;cimColorRamp = colorRampList[0].ColorRamp;&lt;BR /&gt;var rendererDef = new UniqueValueRendererDefinition(fields, null, cimColorRamp,null,false);&lt;BR /&gt;&lt;BR /&gt;renderer = featureLayer?.CreateRenderer(rendererDef);&lt;BR /&gt;&lt;BR /&gt;featureLayer?.SetRenderer(renderer);&lt;BR /&gt;&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;});&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 18:10:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/uniquevaluerendererdefinition-reversed-order/m-p/1606162#M12835</guid>
      <dc:creator>JonathanDewalt</dc:creator>
      <dc:date>2025-04-15T18:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: UniqueValueRendererDefinition reversed order</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/uniquevaluerendererdefinition-reversed-order/m-p/1606182#M12836</link>
      <description>&lt;P&gt;This did the trick after creating renderer.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;renderer &lt;SPAN class=""&gt;is&lt;/SPAN&gt; &lt;SPAN class=""&gt;CIMUniqueValueRenderer&lt;/SPAN&gt; uniqueValueRenderer&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;// Sort the classes in descending order&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; groups &lt;SPAN class=""&gt;=&lt;/SPAN&gt; uniqueValueRenderer&lt;SPAN class=""&gt;.&lt;/SPAN&gt;Groups&lt;SPAN class=""&gt;;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;groups &lt;SPAN class=""&gt;!=&lt;/SPAN&gt; &lt;SPAN class=""&gt;null&lt;/SPAN&gt; &lt;SPAN class=""&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; groups&lt;SPAN class=""&gt;.&lt;/SPAN&gt;Length &lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;// Assuming the first group contains the date classes&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; classes &lt;SPAN class=""&gt;=&lt;/SPAN&gt; groups&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;Classes&lt;SPAN class=""&gt;;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;classes &lt;SPAN class=""&gt;!=&lt;/SPAN&gt; &lt;SPAN class=""&gt;null&lt;/SPAN&gt; &lt;SPAN class=""&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; classes&lt;SPAN class=""&gt;.&lt;/SPAN&gt;Length &lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;// Sort classes by label in descending order&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;Array&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;Sort&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;classes&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;a&lt;SPAN class=""&gt;,&lt;/SPAN&gt; b&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&amp;gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;string&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;Compare&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;b&lt;SPAN class=""&gt;.&lt;/SPAN&gt;Label&lt;SPAN class=""&gt;,&lt;/SPAN&gt; a&lt;SPAN class=""&gt;.&lt;/SPAN&gt;Label&lt;SPAN class=""&gt;,&lt;/SPAN&gt; StringComparison&lt;SPAN class=""&gt;.&lt;/SPAN&gt;Ordinal&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;groups&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;Classes &lt;SPAN class=""&gt;=&lt;/SPAN&gt; classes&lt;SPAN class=""&gt;;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 19:01:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/uniquevaluerendererdefinition-reversed-order/m-p/1606182#M12836</guid>
      <dc:creator>JonathanDewalt</dc:creator>
      <dc:date>2025-04-15T19:01:41Z</dc:date>
    </item>
  </channel>
</rss>

