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

[Solved] Exception on Export after implementing custom filter

1 Answer 129 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darwin
Top achievements
Rank 1
Darwin asked on 26 Apr 2013, 04:53 PM
I recently created a custom drop down filter for use in a RadGrid.  I followed the example from these two links:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filteringtemplatecolumns/defaultcs.aspx
http://www.telerik.com/help/aspnet/grid/grdfilteringwithdropdownlist.html

The grid shows a list of sites.  The drop down displays a list of statuses that can pertain to requests belonging to the site.  See attached screen shot. The column displays a count showing how many of that site's requests have the selected status. 

The grid has an ExportToExcel button.  When clicking that button, the custom control throws the following exception:
 
2013-04-26 10:01:37.923,0000000F,OPSWeb,Unhandled Application Exception [Page Info: /OPSWeb/OPSMain.aspx],Error,Unable to cast object of type 'Telerik.Web.UI.CompressedPageState' to type 'System.Collections.IDictionary'.
10:21

The error occurs in this method on the last line where it adds the combox to the list of controls in the cell..  

        protected override void SetupFilterControls(TableCell cell)
        {
            rcBox = new RadComboBox();
            rcBox.ID = ID;
            rcBox.AutoPostBack = true;
            rcBox.Width = FilterControlWidth;
            rcBox.SelectedIndexChanged += rcBox_SelectedIndexChanged;
            rcBox.DataSource = StatusList;
            cell.Controls.Add(rcBox);
        }

How do I get the export to work?  Why is this causing the export to fail?

Thank you.

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 01 May 2013, 10:25 AM
Hello Darwin,

I was not able to replicate the issue on my side. I prepared a a small sample where I used the example which you used to create your project. As you could see everything work properly. It would be best if you could replicate the issue in a small runnable sample in order to investigate the issue further.

Greetings,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Darwin
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or