Unable to cast object of type 'Telerik.Web.UI.GridImageButton' to type 'Telerik.Web.UI.ElasticButton'

0 Answers 52 Views
Grid
Mohamad Javad
Top achievements
Rank 1
Iron
Mohamad Javad asked on 24 Apr 2023, 03:09 PM

hi 

I use radGrid with the following code:

         <telerik:RadGrid  
                ID="RadGrid_Fibers"  
                RenderMode="Auto"
                GridLines="Both" runat="server"
                Skin="Sunset"
                DataSourceID="SqlDataSource1_SP_Tow_Prog_Fibers_Select"
                AutoGenerateColumns="False">

                <MasterTableView Width="100%" ShowFooter="True"
                    DataSourceID="SqlDataSource1_SP_Tow_Prog_Fibers_Select"
                    DataKeyNames="TowProgFibers_ID">

                    <GroupByExpressions>
                        <telerik:GridGroupByExpression>
                            <SelectFields>
                                <telerik:GridGroupByField FieldAlias="Tow_Had" FieldName="Tow_Had" FormatString="" HeaderText="" />
                            </SelectFields>
                            <GroupByFields>
                                <telerik:GridGroupByField FieldAlias="Tow_Had" FieldName="Tow_Had" FormatString="" HeaderText="" />
                            </GroupByFields>
                        </telerik:GridGroupByExpression>
                    </GroupByExpressions>


  that when a skin such as sunset is used, radGrid works without problems.

But when I don't want to use skin and Skin ="" is set with an error:

Unable to cast object of type 'Telerik.Web.UI.GridImageButton' to type 'Telerik.Web.UI.ElasticButton'

How to solve this problem? please help.

Rumen
Telerik team
commented on 27 Apr 2023, 09:01 AM

Would you please confirm that the Compatibility Mode of Internet Explorer is disabled? 
https://www.telerik.com/support/kb/aspnet-ajax/details/disable-the-compatibility-view-mode-of-internet-explorer
https://www.telerik.com/support/kb/aspnet-ajax/details/different-appearance-in-internet-explorer-on-local-and-production-servers

Most probably the compatibility mode triggers different rendering for the Grid and the cast to Elastic Button fails. 
If the problem happens in MS Edge make sure that the browser does not render the page in IE Mode - https://stackoverflow.com/questions/61531782/how-to-block-chromium-edge-from-using-ie-mode-on-single-page

Also if you do not want to set a skin at all, you can just delete the Skin="" property and its empty string value and the Grid will load its default skin.

  

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Mohamad Javad
Top achievements
Rank 1
Iron
Share this question
or