title: How can i sort and display <IList> elements in radio button?
body: <p>I have data <code>IList&lt;String&gt;</code> type in my Model returning string date in <code>yyyyMM</code> format, I need help to display array elements in radio button sorted descending order in <code>MM/yyyy</code> format.</p>
  <p>My Model look like as follows:</p>
  <pre><code> public class DataToLoad
   {
          public List&lt;string&gt; Months{ get; set; }       
   }
  </code></pre>
  <p>In my view I have the following to display array element in radio button.</p>
  <pre><code>foreach (var record in Model.Months)
  {
    &lt;div class=&quot;radio col-12&quot;&gt;
       &lt;div class=&quot;row&quot;&gt;
         &lt;div class=&quot;col-5&quot; style=&quot;&quot;&gt;
           @Html.RadioButton(&quot;Months&quot;, record, true, new { id = record, @class = &quot;m-r&quot; })&lt;label&gt;@record&lt;/label&gt;
          &lt;/div&gt;
        &lt;/div&gt;
     &lt;/div&gt;
  }
  </code></pre>
  <p>I need if <code>Months</code> return 199008 and 19909, I want to sort values descending and format as MM/yyyy and display the values using radio button <code>09/1990 first then 08/1990</code>. Any Help?</p>