In order to use the built-in parameters area of the report, we would need to create a report Parameter that lists the column names. We can do that by creating a Business object that holds this for us:
public class ColumnSelector : DataTable
this.Rows.Add("Email Address", "EmailAddress");
this.Rows.Add("Not Sorted", "Not Sorted");
The last row is added simply for the sake of being able to show the report data unsorted if needed. We set the DisplayMember property of the parameter to displayText column and ValueMember to sortColumn column. Of course we should not forget to set the Visible property of the Report Parameter to true in order to show the parameter area above the ReportViewer.
Now is time to set the actual sorting:
Subscribe to be the first to get our expert-written articles and tutorials for developers!
All fields are required
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.