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

Export to excell selected row from hierarchical grid

3 Answers 128 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Atul
Top achievements
Rank 1
Atul asked on 13 Mar 2012, 12:38 PM

we are using radGrid and having details table inside master table view  and an event onneeddatasource and checkbox column onside of radgrid and i want to export only selected row to excel..but the problem is that it is exporting all record to excell sheet beside selection of rows please help me ????????????????????????????

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Mar 2012, 01:20 PM
Hello,

Try the following code.
C#:
protected void Button2_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(); 
}

-Shinu.
0
Atul
Top achievements
Rank 1
answered on 14 Mar 2012, 08:52 AM
hi shinu

please  give me another solution...because previous solution are not work .
???????????????????
0
Shinu
Top achievements
Rank 2
answered on 19 Mar 2012, 01:43 PM
Hi Atul,

The above code is working fine at my end with Excel-Format="Html".Please specify which Excel-Format you are using or can you paste your complete code?My suggestion is valid for the HTML Excel type only. If the Excel-Format is "ExcelML" it gets the data straight from the datasource and it doesn't care if the rows are hidden or not .

Thanks,
-Shinu.
Tags
General Discussions
Asked by
Atul
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Atul
Top achievements
Rank 1
Share this question
or