Exporting an unbound Gridview to csv RRS feed

  • Question

  • User1027206698 posted

    Does anybody know how to export data from an unbound Gridview to csv?

    I can do it with a bound Gridview but when I try the same code with an unbound Gridview the resulting file is empty/blank lines.

    The grid is populated in the code behind and may have paging, depending on volume of data.

    Does an unbound grid treat data different to a bound one?


    Thursday, September 13, 2018 8:21 AM

All replies

  • User839733648 posted

    Hi conners,

    According to your description, I could not fully understand what an unbound Gridview is.

    The process that you export data from Gridview to csv needs to bind your data that you want.

    If there is no data binding, the resulting file will be blank.

    If possible, please describe unbound Gridview in detail or provide your codes so that it will be easier for us to help with you.

    Best Regards,


    Friday, September 14, 2018 9:59 AM
  • User-1171043462 posted

    If GridView is not bound with Data what do you want to export then?

    Monday, October 8, 2018 11:52 AM
  • User-2051535749 posted

    Just export the dataset to a CSV in the code behind when the page loads or the user clicks a button, if the grid isn't bound, is has no data to export

    Monday, October 8, 2018 12:50 PM
  • Monday, October 8, 2018 1:49 PM