I am building a web application which contains list of grids in different area's. All have export options working fine but there is one grid which Export blank CSV even there is record. I have tried every possible option but no output. Any help would be appreciated. this is the HTML code.
<telerik:RadGrid ID="radGridSelectUser" runat="server" Skin="Office2007"
AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true"
AllowMultiRowSelection="true" Width="99%" >
<GroupingSettings CaseSensitive="false" />
<Pdf FontType="Link" PaperSize="A4" />
<Excel Format="Html" />
<Csv ColumnDelimiter="Comma" RowDelimiter="NewLine" />
<Selecting AllowRowSelect="true" />
<!-- This is my custom footer-->
<uc1:gridFooter ID="gridFooter" runat="server" />
<telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" DataField="Username" SortExpression="Username" FilterControlWidth="95%" >
<asp:LinkButton runat="server" ID="lnkUserName" OnClick="lnkUserName_Click" ToolTip='<%# DataBinder.Eval(Container.DataItem,"Username")%>' CommandName="SELECT" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"UserId")%>' Text='<%# DataBinder.Eval(Container.DataItem,"Username")%>'></asp:LinkButton>
Code Behind on Button Click
// There are mostly records between 2- 10
13 Answers, 1 is accepted
I suggest you using the tips from this section of the documentation (paragraph 'Exporting GridButtonColumn/GridTemplateColumn/GridHyperLinkColumn data') to export the template column.
All the best,
the Telerik team
Thanks for the link, I have added another column in the grid
telerik:GridBoundColumn DataField="Username" HeaderText="Username" AllowSorting="true" Display="true" ></telerik:GridBoundColumn>
this is GroupBound column which must be exported but even then I get CSV with headers only.i-e Username , Username and thats it.
so if it does not find the data for first column then it must display the second one but nothing here.
Any other options ?
I followed your scenario in order to replicate the issue but to no avail. Please find attached a simple runnable application which is working as expected. Give it a try and let me know what is the difference in your case.
Looking forward for your reply.
All the best,
the Telerik team
I am unable to replicate my problem on your sample page neither able to fix it on my application but there are 2 issues which arise on this page and may be useful for you as I am not facing these problems on my main application.
You can download the source from
I have removed the telerik files from bin which you can put back before playing with it.
problems on newly added grid
1) If you click next on navigation then it will not work but if you will click on page "2" then it will.
2) if you export the grid to CSV then file name should be "Username.csv" but it would be something like Username324234.csv
these problems do not appear in my orignal application but appear here so I thought to brought them in your attention.
Could you please verify that this is the correct link, because I was not able to open it?
It will be best if you can open a formal support ticket and send us a simple running project demonstrating the problem (and step-by-step instructions on doing so). In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.
the Telerik team
The link is still alive but it is case sensitive so please copy paste this
in browser and it should work. As far the issue is concerned, I am facing this only on grid in my entire application so reproducing it is not a piece of cake :-) even I am not able to recreate it on other controls. May be rebuilding the contrl from scratch would resolve the problem.
I shall try it again on another application and if I manage to reproduce it then I shall get the ticket and will update here as well.
I have similar problem.
When I export to Word, Excel or PDF it works fine.
With CSV it generates file with only header information.
I am trying to exprot grid which is not visible. If i make visible="true" it works fine.
Is there a way to make it work with visible="false"
Please find attached a modified project that demonstrates the needed approach. Note that Simple data-binding through the DataBind() method can be used in simple scenarios which does not require complex operations like paging. For advanced features such as paging, RadGrid must be bound through the NeedDataSource event.
Additionally, as you can see from the attached screenshot the name of the CSV file is "Username.csv".
the Telerik team
My page is using an on-page data source.
But my export to excel isn't working.
Is this the reason?
There could be different reasons, depending on the grid configuration and data binding.
Can you please elaborate on the "on-page data source"?
- Are you referring to, binding data during Page Load?
- Is there any custom logic that is supposed to handle the exporting manually?
It would be very helpful if you could share more details.
Here are some demos and samples regarding the export functionality:
- Grid - Export to Excel
- Exporting Overview
- Export HTML content into Docx
- Export large amount of data to PDF, XLSX and CSV using the Telerik Document Processing libraries
The application uses Telerik.Web.UI, version 2014.2.724.40.
The web page has an embedded ObjectDataSource, which calls a method in the code behind, which in turn calls a stored procedure to return the data set.
The Telerik RadGrid has both ShowExportToExcelButton and ShowExportToCsvButton set to "true".
When the export to excel button is pressed, I want all data from the Dataset associated with the RadGrid exported to excel, not just what's on the grid.
When extract type is HTML, I get an empty excel spread sheet. When extract type is ExcelML, I get an error about advanced binding. I don't care if the extract is in HTML or EcelML, I just want the user to be able to pull a copy of the dataset.
I'd attach a code extract, but only images are allowed.
To continue the investigation on this case, I suggest that you open a formal support ticket and share the details with us. The system will allow you to attach almost any kind if compressed in a zip file.
The best would be if you could send us a runnable sample that produces the error, though, sending only the aspx page and the its code behind file would also be enough to get an idea about the scenario.
Also, please mention the link to this forum in the support ticket as a reference: Export to CSV returns empty file
Once we found a solution, we will share it in this forum thread to to make it available for the community.