How to export Gridview data to csv with gridview styles.Below code will do for Excel but i want to download CSV.
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename= ABCReport.xls")
Response.Charset = ""
Response.ContentType = "application/vnd.ms-excel"
Using sw As New StringWriter()
Dim hw As New HtmlTextWriter(sw)
DGReport.RenderControl(hw)
'style to format numbers to string
Dim style As String = "<style> .textmode { } </style>"
Response.Write(style)
Response.Output.Write(sw.ToString())
Response.Flush()
Response.[End]()
End Using