title: Looking to export datagridview
body: <p>I have a scrolling datagridview that dyanmically changes it's number of columns and rows. I'm looking for a way to export the datagridview as it is when the user clicks a button. I want it to export as something that cannot be edited (so not excel file). I've tried using iTextSharp to export as pdf and can't seem to come up with a dynamically changing loop that would suit it. Also, I haven't been able to find any sample code using iTextSharp that included also exporting row headers along with column headers. I've also tried one solution (that I can't seem to find at the moment) on the microsoft forums that takes advantage of a the add-on functionality of Excel to write to PDF after the datagridview contents are exported to it. The problem I have with that is it creates way to many pages as well as still shows rows that have been hidden or deleted from the datagridveiw. Any idea of how I can accomplish this feat? </p>
  
  <p>I'll include two pictures to show the way in which the datagridview is dynamically populated and changes</p>
  
  <p>It can have up to 66 rows and 12 columns (not including row or column headers)
  <a href="https://i.stack.imgur.com/09a8s.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/09a8s.jpg" alt="datagridview example 1"></a>
  
  <a href="https://i.stack.imgur.com/qx7d6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qx7d6.jpg" alt="datagridview example 2"></a>
  </p>