Trying to export asp.net gridview to a .csv file

后端 未结 2 1576
耶瑟儿~
耶瑟儿~ 2021-01-29 04:20

I am trying to export a gridview to a csv file but my code seems to be only exporting the header.

Here is my code:

Protected Sub btnCSV_Click(sender As O         


        
相关标签:
2条回答
  • 2021-01-29 05:08

    I found the solution!! Comment out

         gvReports.AllowPaging = False
         gvReports.DataBind()
    
    0 讨论(0)
  • 2021-01-29 05:12

    in place

    gvReports.DataBind() 
    

    call function

    me.binddata() 
    

    that can load data to gridview. binddata is the function name

    0 讨论(0)
提交回复
热议问题