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

how can i export current selected row to excel

1 Answer 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sam
Top achievements
Rank 1
sam asked on 04 Oct 2010, 01:40 PM
hello i need help with grid exporting
i want to export a selected row   ,i have a button template column for export but not working for the current row
in addition i would like to choose the column that i wish to export
thanks for any help or suggestion

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Oct 2010, 01:46 PM
Hello Sam,


You can explicitly hide the rows before exceuting the ExportToPdf() method.

C#:
protected void Button1_Click(object sender, EventArgs e)  
{  
    if (RadGrid1.SelectedItems.Count != 0)  
    {  
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items)  
        {  
            if (!item.Selected)  
                item.Visible = false;  
        }
    }  
    RadGrid1.ExportSettings.OpenInNewWindow = true;  
    RadGrid1.MasterTableView.ExportToPdf();  
}


And the documentation will help you more on this topic:
http://www.telerik.com/help/aspnet-ajax/grid-html-export.html


Thanks,
Princy.
Tags
Grid
Asked by
sam
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or