RadGrid export to Excel and set Excel autofilter

8 posts, 1 answers
  1. Celeste
    Celeste avatar
    44 posts
    Member since:
    Oct 2010

    Posted 15 Nov 2010 Link to this post

    Dear Forum,

    Is there any way to set the autofilter property in Excel when exporting a table from RadGrid?

    Thank you,
    Celeste
  2. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 15 Nov 2010 Link to this post

    Hello Celeste,

    Can you please post some more information about the functionality you would like to implement? This way I will be able to provide more to-the-point suggestion.

    Regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Celeste
    Celeste avatar
    44 posts
    Member since:
    Oct 2010

    Posted 16 Nov 2010 Link to this post

    Daniel,

    In Excel, open a workbook and then from the menu select Data => Filter => AutoFilter. That is the Excel AutoFilter feature. I would like to have that Excel feature enabled on the workshett that is exported from RadGrid to Excel.

    Celeste
  5. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 16 Nov 2010 Link to this post

    Hello Celeste,

    This functionality is enabled out-of-the-box when using the ExcelML format.
    Export to ExcelML demo

    Let me know whether this helps.

    Best regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  6. Celeste
    Celeste avatar
    44 posts
    Member since:
    Oct 2010

    Posted 16 Nov 2010 Link to this post

    Daniel,

    I'm using HTML format.

    Celeste
  7. Celeste
    Celeste avatar
    44 posts
    Member since:
    Oct 2010

    Posted 16 Nov 2010 Link to this post

    Daniel,

    I've changed the format for the export to ExcelML and I no longer get any data:

    Also, I got this error from the code example:

    Error 24 'Telerik.Web.UI.GridExcelBuilder.WorksheetOptionsElement' does not contain a definition for 'ActivePane' and no extension method 'ActivePane' accepting a first argument of type 'Telerik.Web.UI.GridExcelBuilder.WorksheetOptionsElement' could be found (are you missing a using directive or an assembly reference?) 

    I've added both the assembly references in the example
    using Telerik.Web.UI.GridExcelBuilder;
    using System.Web.UI.WebControls;

    So thie ExcelML format is really not working for me at all...
    Celeste
  8. Answer
    Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 16 Nov 2010 Link to this post

    Hello Celeste,

    Judging by the provided information, I suppose that you are trying to use new features (ActivePane property) with an older version of RadControls for ASP.NET AJAX. Please download the up-to-date version and try again.

    As to the HTML format - I'm afraid we do not support AutoFilter when exporting in this format.

    Regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  9. Sunil
    Sunil avatar
    230 posts
    Member since:
    Jan 2004

    Posted 29 Jan 2011 Link to this post

    Hi Celeste,

    To automatically make filters appear in header row when exporting data as html, you need to follow the guidelines below. This works in Excel 2003 and Excel 2010 as I have tested in both.
    • You need to include some standard Excel schemas in your < html> tag. You can simply copy and paste the html tag in listing below.
    • You need to include an attribute that says x:autofilter = 'all' for each column header td tag. Don't do this for column value td tags.
    For an example, you can see the listing below that can be saved as a '.xls' file.
    Thanks
    Sunil

    <html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
     
    <head></head>
     
    <body >
     
    <table >
      
     <tr >
      <td  width=130 x:autofilter='all'  
      >Age</td>
      <td  width=130 x:autofilter='all'
      >Salary</td>
     </tr>
     <tr height=18 style='height:13.2pt'>
      <td  >34</td>
      <td >2333</td>
     </tr>
     <tr >
      <td>55</td>
      <td>1222</td>
     </tr>
      
    </table>
     
    </body>
     
    </html>
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017