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

export selected rows radgrid

1 Answer 18 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 30 Sep 2013, 12:32 PM

   Hi,
       Can I export only selected rows from radgrid. If yes, how can I have this done. I was planning to export on external button click.

   Thanks
   Ryan

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 30 Sep 2013, 12:36 PM
Hi,

Please try the following code snippet to Export only selected rows in RadGrid.

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,
Princy.
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or