This is a migrated thread and some comments may be shown as answers.

Activate spreadsheet "auto-filter" in code

1 Answer 145 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Thys
Top achievements
Rank 1
Thys asked on 06 Aug 2016, 07:51 AM

We are building a spreadsheet from values received from a database and would like to automatically enable the filter on that. We can execute the SetFilterRange command, but how can one select the used cell range in code before calling this command?

Any other solution would be appreciated, but essentially we just need the spreadsheet on its own to be displayed, but with filtering enabled on all used columns.

1 Answer, 1 is accepted

Sort by
0
Nikolay Demirev
Telerik team
answered on 10 Aug 2016, 11:00 AM
Hello Thys,

The following code snippet will set the filter range to the entire used cell range of the Worksheet:
this.radSpreadsheet.ActiveWorksheet.Filter.FilterRange = this.radSpreadsheet.ActiveWorksheet.UsedCellRange;

Regards,
Nikolay Demirev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Spreadsheet
Asked by
Thys
Top achievements
Rank 1
Answers by
Nikolay Demirev
Telerik team
Share this question
or