Hi I have a RadGrid that I'm exporting to pdf but the rows in the pdf are not sorted the same way they are in the grid. Do I need to do something additional to export the sorting settings of the grid?
This is the code I'm using to export the grid:
This is the code I'm using to export the grid:
grid.MasterTableView.ExportToPdf();
Thanks!
4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 19 Mar 2013, 04:45 AM
Hi,
You can set the GridSortExpression as shown below.
C#:
Thanks,
Shinu
You can set the GridSortExpression as shown below.
C#:
protected void Button2_Click(object sender, EventArgs e){ GridSortExpression expression = new GridSortExpression(); expression.FieldName = "YourField"; expression.SortOrder = GridSortOrder.Descending; RadGrid1.MasterTableView.SortExpressions.AddSortExpression(expression); RadGrid1.MasterTableView.ExportToPdf(); RadGrid1.MasterTableView.Rebind();}Thanks,
Shinu
0
Eddy
Top achievements
Rank 1
answered on 19 Mar 2013, 06:44 PM
Hi
Thanks for your help but that did not work, it didn't sort the rows in the pdf by the field I specified
Thanks for your help but that did not work, it didn't sort the rows in the pdf by the field I specified
0
Hi Eddy,
I was not able to reproduce the issue. I prepared a small sample and attached it to this forum post. Could you please give it a try and let me know how it differs from your real setup?
All the best,
Kostadin
the Telerik team
I was not able to reproduce the issue. I prepared a small sample and attached it to this forum post. Could you please give it a try and let me know how it differs from your real setup?
All the best,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Eddy
Top achievements
Rank 1
answered on 21 Mar 2013, 06:56 PM
Thanks! I got it to work. The issue was that after the call to ExportToPdf() the event OnNeedDataSource was being fired