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

Export only selected rows

1 Answer 44 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tina
Top achievements
Rank 1
Tina asked on 06 Mar 2013, 10:20 AM
How to export only selected rows in radgrid from external button click?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Mar 2013, 10:30 AM
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
Tags
General Discussions
Asked by
Tina
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or