Hi,
I am using custom paging in my grid with a ObjectDataSource. I have read that we can also do custom paging using the NeedDataSource event. I would like to know what is the criteria to select the method (ObjectDataSource or NeedDataSource ).
Thanks
ExportGridUserControl.ExportGrid = radGridCategory;
property in my user control
| public RadGrid ExportGrid |
| { |
| get |
| { |
| if (Session["Grid"] != null) |
| { |
| return (RadGrid)Session["Grid"]; |
| } |
| else |
| return null; |
| } |
| set |
| { |
| Session["Grid"] = value; |
| } |
| } |
my excel export method in my user control
| protected void imbExcel_Click(object sender, ImageClickEventArgs e) |
| { |
| try |
| { |
| if (ExportGrid.Columns.FindByUniqueName("TemplateSil") != null) ExportGrid.Columns.FindByUniqueName("TemplateSil").Visible = false; |
| } |
| catch { } |
| try |
| { |
| if (ExportGrid.Columns.FindByUniqueName("TemplateDuzenle") != null) ExportGrid.Columns.FindByUniqueName("TemplateDuzenle").Visible = false; |
| } |
| catch { } |
| try |
| { |
| if (ExportGrid.Columns.FindByUniqueName("TemplateDetay") != null) ExportGrid.Columns.FindByUniqueName("TemplateDetay").Visible = false; |
| } |
| catch { } |
| if (rblAktarmaSekli.SelectedValue == "0") |
| ExportGrid.ExportSettings.IgnorePaging = true; |
| else |
| ExportGrid.ExportSettings.IgnorePaging = false; |
| ExportGrid.MasterTableView.ExportToExcel(); |
| } |
What is problem? By the way throw exception when FindByUniqueName not found item also coltrol null value.
Response.ContentType =
"application/vnd.ms-excel";
Response.AppendHeader(
"Content-Disposition", "attachment; filename=Test12.xls");
Response.TransmitFile(Server.MapPath(
"/Excel/Test12.xls"));
Response.End();
Can you please look into it and suggest what steps I have to take to avoid this .
Regards
Manoj


