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

export to excel problem

1 Answer 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Neeraj
Top achievements
Rank 1
Neeraj asked on 09 Oct 2012, 01:19 PM
hiii all,
     can anyone help me?
i am using telerik grid. Problem is when i click on export to excel link button while grid is empty.
in excel i am not getting anything.
i want to show headers of the grid in the excel sheet.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Oct 2012, 04:24 AM
Hi,

Try the following code to show headers when exporting.
C#:
protected void LinkButton2_Click(object sender, EventArgs e)
{
       Radgrid1.MasterTableView.ShowHeadersWhenNoRecords = true;
       Radgrid1.MasterTableView.ExportToExcel();
}

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