Export only selected rows

2 posts, 0 answers
  1. Tina
    Tina avatar
    130 posts
    Member since:
    Jul 2011

    Posted 06 Mar 2013 Link to this post

    How to export only selected rows in radgrid from external button click?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Mar 2013 Link to this post

    Hi,

    Try the following code.
    C#:
    protected void Button1_Click(object sender, EventArgs e)
    {
            foreach (GridDataItem item in RadGrid1.Items) 
            
                if (item.Selected==false
                
                    item.Visible = false
                
            
            RadGrid1.ExportSettings.ExportOnlyData = true
            RadGrid1.ExportSettings.OpenInNewWindow = true
            RadGrid1.MasterTableView.ExportToExcel(); 
    }

    Thanks,
    Shinu
Back to Top