title: Display Serial number in datagridview (DESC order) C#
body: <p>I want to display row number in datagridview as DESC ORDER.</p>
  
  <p>I use following code in "RowPostPaint Event" to Display Serial number in datagridview.</p>
  
  <pre><code>        DataGridView grid = (DataGridView)sender;
          System.Drawing.Font rowFont = new System.Drawing.Font("Tahoma", 8f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, Convert.ToByte(0));
  
          dynamic centerFormat = new StringFormat();
          centerFormat.Alignment = StringAlignment.Far;
          centerFormat.LineAlignment = StringAlignment.Near;
          string rowIdx = (e.RowIndex + 1).ToString();
          Rectangle headerBounds = new Rectangle(e.RowBounds.Left, e.RowBounds.Top, grid.RowHeadersWidth, e.RowBounds.Height);
          e.Graphics.DrawString(rowIdx, rowFont, SystemBrushes.ControlText, headerBounds, centerFormat);
  </code></pre>
  
  <blockquote>
    <p><strong>Code Above gives Following Result</strong></p>
  </blockquote>
  
  <p>1
  2
  3
  .
  .
  10</p>
  
  <p><a href="http://i.stack.imgur.com/K9wAD.png" rel="nofollow">Screen Short 1 - Result of above code</a></p>
  
  <blockquote>
    <p><strong>Image Below is a sample of what I want</strong></p>
  </blockquote>
  
  <p>10
  9
  8
  7
  .
  .
  1</p>
  
  <p><a href="http://i.stack.imgur.com/YA7Ff.png" rel="nofollow">Screen Short 2 - A sample of what i want</a></p>
  
  <p>The first method is depended On "RowIndex" . is there any way to do this using "RowCount" or something like that.</p>
  
  <p>I want to display serial number in Descending Order Like Second Image.How to do this...?</p>