Disabling rows to be exported according to a condition

2 posts, 0 answers
  1. Ueli
    Ueli avatar
    5 posts
    Member since:
    Dec 2013

    Posted 30 May 2014 Link to this post


    I just wonder whether it would be directly possible to have certains rows not exported based on a condition I set or whether I need to exclude them manually.

  2. Stefan
    Stefan avatar
    2906 posts

    Posted 31 May 2014 Link to this post

    Hi Ueli,

    Thank you for writing.

    To exclude a row from being exported, you need to set its IsVisible property to false and the exporter's HiddenRowOption to DoNotExport:
    private void radButton1_Click(object sender, EventArgs e)
        ExportToExcelML exporter = new ExportToExcelML(this.radGridView1);
        exporter.HiddenRowOption = HiddenOption.DoNotExport;
        string fileName = "C:\\ExportedData123.xls";
        foreach (var item in radGridView1.Rows)
            item.IsVisible = false;  
        foreach (var item in radGridView1.Rows)
            item.IsVisible = true;

    I hope this helps.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top