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

[Solved] IgnorePaging and filter problem in grid export

1 Answer 125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Legalia
Top achievements
Rank 1
Legalia asked on 28 Apr 2009, 07:01 AM
Hi..
I am hiding column filter while exporting grid to excel. it works fine if i do not add grid1.ExportSettings.IgnorePaging = true;
if i add IgnorePaging = true; it adds one blank row in exported excel file.

protected void btn_Click(object sender, EventArgs e) 
{         
    foreach (GridItem commandItem in this.grid1.MasterTableView.GetItems(GridItemType.FilteringItem)) 
    { 
        commandItem.Visible = false
    } 
 
    grid1.ExportSettings.FileName = "file"
    grid1.ExportSettings.ExportOnlyData = true
    grid1.ExportSettings.OpenInNewWindow = true
    grid1.ExportSettings.IgnorePaging = true
    grid1.MasterTableView.ExportToExcel(); 

IgnorePaging is creating problem.
how can it be solved.?

Thanks,

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 28 Apr 2009, 09:06 AM
Hi Legalia,

Give a try with the following code snippet to hide the filter row and see if it works.

CS:
 
 protected void Button1_Click(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.AllowFilteringByColumn = false
        RadGrid1.Rebind(); 
    
       RadGrid1.ExportSettings.ExportOnlyData = true
       RadGrid1.ExportSettings.OpenInNewWindow = true
       RadGrid1.ExportSettings.IgnorePaging = true
       RadGrid1.MasterTableView.ExportToExcel();  
    } 


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