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

Export data on user control

1 Answer 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tolga AYKURT
Top achievements
Rank 1
Tolga AYKURT asked on 11 Mar 2009, 08:44 AM
I have a user control and there is a property of my user control - "ExportGrid". ExportGrid property take "export grid" from include page. But in this wise not export data.

in page Load() event of contain page to my user control

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.

 

 

 

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 16 Mar 2009, 08:01 AM
Hi Tolga AYKURT,

Unfortunately I am not able to determine where the exact source of the issue is. I will ask you to prepare a working sample project which reproduces the described error and attach it to a regular support ticket.
Thus I will do all my best to find an up-to-the-point solution/fix of this issue.

Regards,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Tolga AYKURT
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or