title: export datagridview according to displayed colums
body: <p>I have a datagridview with <code>column reordering = True</code>. I have changed the orders of the columns  and want to extract according to this reordered data.
  Here is datagridview with default values.<img src="https://i.stack.imgur.com/NSpkh.png" alt="enter image description here"></p>
  
  <p>Now i have reordered the columns as : </p>
  
  <p><img src="https://i.stack.imgur.com/E8lqG.png" alt="enter image description here"></p>
  
  <p>i want to export the data to a text file according to this reordered columns. </p>
  
  <p>When i am using the code :</p>
  
  <pre><code>        Dim Strng As String = Nothing ' dgg is datagridview '
          For i As Integer = 0 To dgg.RowCount - 1
              For j As Integer = 0 To dgg.Columns.Count - 1
                  Strng += vbNewLine + dgg.Rows(i).Cells(j).Value
              Next
          Next
  </code></pre>
  
  <p>it showing acc as column 0 and newacc as column 2. But i need data as it is in dridview i.e. name in column 0 and add in column 1..
  <br>
  Please help me out . Thanks in advance..</p>