Unable to cast object of type 'Telerik.Windows.Controls.RadGridView' to type 'Telerik.Windows.Controls.GridView.GridViewDataControl'

5 posts, 0 answers
  1. Natraj
    Natraj avatar
    4 posts
    Member since:
    Aug 2011

    Posted 30 Aug 2011 Link to this post

    I am getting the above exception when I open a page that has a RadGridView, verified all teh references and removed and added them back with the same effect. Closing the application and opening it can fix it for a few seconds ..but it comes back.. Please help/suggest.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 31 Aug 2011 Link to this post

    Hello,

     Can you post more info about the grid version? Can you send us this project where we can replicate the problem?

    Regards,
    Vlad
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. Natraj
    Natraj avatar
    4 posts
    Member since:
    Aug 2011

    Posted 31 Aug 2011 Link to this post

    This is happening only on one page where we have the below   <telerik:RadGridView.RowDetailsTemplate> ..
    taking this code block out and closing and reopening blend fixes it. Once the exception occurs in Blend .. all telerik RadGridView pages fail to render ..


    more ...
        <telerik:RadGridView.Columns>                  
    more .....            
      </telerik:GridViewDataColumn>
           </telerik:RadGridView.Columns>
      <telerik:RadGridView.RowDetailsTemplate>
                        <DataTemplate>                        
                            <telerik:RadGridView IsReadOnly="True" AutoGenerateColumns="False" ShowGroupPanel="False"   Grid.Row="2"  
                                CanUserReorderColumns="False" CanUserResizeColumns="True" Width="1000"             
                                RowIndicatorVisibility="Collapsed" IsFilteringAllowed="True" MaxHeight="300" MinHeight="40"
                                  ItemsSource="{Binding Path=AccountDetails}" telerik:StyleManager.Theme="Office_Blue" GridLinesVisibility="None">
                                <telerik:RadGridView.Columns>
                                    <telerik:GridViewDataColumn x:Name="AccountNumber" Header="AccountNumber" DataMemberBinding="{Binding Path=AccountNumber, Mode=TwoWay, Converter={StaticResource TextTrimByCharacter},ConverterParameter=23}" Width="200" ToolTipTemplate="{StaticResource AccountNumberTooltip}"/>
                                    <telerik:GridViewDataColumn x:Name="BillToAddress" Header="BillToAddress" DataMemberBinding="{Binding Path=BillToAddress, Mode=TwoWay, Converter={StaticResource TextTrimByCharacter},ConverterParameter=30}" Width="200" ToolTipTemplate="{StaticResource BillToAddressTooltip}"/>
                                    <telerik:GridViewDataColumn x:Name="ShipToAddress" Header="ShipToAddress" DataMemberBinding="{Binding Path=ShipToAddress, Mode=TwoWay, Converter={StaticResource TextTrimByCharacter},ConverterParameter=30}" Width="200" ToolTipTemplate="{StaticResource ShipToAddressTooltip}"/>
                                    <telerik:GridViewDataColumn x:Name="Notes" Header="Notes" DataMemberBinding="{Binding Path=Notes, Mode=TwoWay, Converter={StaticResource TextTrimByCharacter},ConverterParameter=60}" Width="400" ToolTipTemplate="{StaticResource NotesTooltip}"/>
                                </telerik:RadGridView.Columns>
                            </telerik:RadGridView>
                        </DataTemplate>
                    </telerik:RadGridView.RowDetailsTemplate>

  4. Natraj
    Natraj avatar
    4 posts
    Member since:
    Aug 2011

    Posted 31 Aug 2011 Link to this post

    posted too soon, it is not fixed.

                <telerik:RadGridView IsReadOnly="True" AutoGenerateColumns="False" ShowGroupPanel="False"   Grid.Row="2"  
                            CanUserReorderColumns="False" CanUserResizeColumns="True"             
                                RowIndicatorVisibility="Collapsed" IsFilteringAllowed="True" MaxHeight="400" MinHeight="40"
                                 ItemsSource="{Binding TransactionProfileList, Mode=TwoWay}"   telerik:StyleManager.Theme="Office_Blue"
                                 GridLinesVisibility="None">
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewToggleRowDetailsColumn />
                        <telerik:GridViewDataColumn x:Name="colSelect" Header="" TextAlignment="Center" IsFilterable="True">
                      ..................................
    .........................................
                            </telerik:GridViewDataColumn.CellTemplate>
                        </telerik:GridViewDataColumn>
                    </telerik:RadGridView.Columns>

                    <telerik:RadGridView.RowDetailsTemplate>
                        <DataTemplate>                        
                            <telerik:RadGridView IsReadOnly="True" AutoGenerateColumns="False" ShowGroupPanel="False"   Grid.Row="2"  
                                CanUserReorderColumns="False" CanUserResizeColumns="True" Width="1000"             
                                RowIndicatorVisibility="Collapsed" IsFilteringAllowed="True" MaxHeight="300" MinHeight="40"
                                  ItemsSource="{Binding Path=AccountDetails}" telerik:StyleManager.Theme="Office_Blue" GridLinesVisibility="None">
                                <telerik:RadGridView.Columns>
                                    <telerik:GridViewDataColumn x:Name="AccountNumber" Header="AccountNumber" DataMemberBinding="{Binding Path=AccountNumber, Mode=TwoWay, Converter={StaticResource TextTrimByCharacter},ConverterParameter=23}" Width="200" ToolTipTemplate="{StaticResource AccountNumberTooltip}"/>
                                    <telerik:GridViewDataColumn x:Name="BillToAddress" Header="BillToAddress" DataMemberBinding="{Binding Path=BillToAddress, Mode=TwoWay, Converter={StaticResource TextTrimByCharacter},ConverterParameter=30}" Width="200" ToolTipTemplate="{StaticResource BillToAddressTooltip}"/>
                                    <telerik:GridViewDataColumn x:Name="ShipToAddress" Header="ShipToAddress" DataMemberBinding="{Binding Path=ShipToAddress, Mode=TwoWay, Converter={StaticResource TextTrimByCharacter},ConverterParameter=30}" Width="200" ToolTipTemplate="{StaticResource ShipToAddressTooltip}"/>
                                    <telerik:GridViewDataColumn x:Name="Notes" Header="Notes" DataMemberBinding="{Binding Path=Notes, Mode=TwoWay, Converter={StaticResource TextTrimByCharacter},ConverterParameter=60}" Width="400" ToolTipTemplate="{StaticResource NotesTooltip}"/>
                                </telerik:RadGridView.Columns>
                            </telerik:RadGridView>
                        </DataTemplate>
                    </telerik:RadGridView.RowDetailsTemplate>          
         
                </telerik:RadGridView>
  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 05 Sep 2011 Link to this post

    Hello Natraj,

     

    Most probably there is some inconsistency in the telerik assemblies you used.
    Will you verify the telerik assemblies are all with the same version? It could be great if you may share whether the exception is reproduceable only in Expression Blend Environment or not. 
    Also you may take a look at the following thread with an issue related to the yours, follow this link. 
    If this does not help feel free to submit a new support ticket where you may attach your application. 
    We may take a look at it and provide you with an appropriate solution. 


    Kind regards,
    Vanya Pavlova
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top