error "... cannot be converted to..."

8 posts, 0 answers
  1. Hong
    Hong avatar
    15 posts
    Member since:
    Dec 2012

    Posted 23 Jan 2014 Link to this post

    When I replace a TextBox of a working app with RadTextBox, the designer is immediately messed up showing the following error:
     
    ArgumentException: Object of type 'Telerik.Windows.Controls.GridLayoutPosition' cannot be converted to type 'Telerik.Windows.Controls.GridLayoutPosition'.

    I am having a hard time to comprehend the meaning of this error. Any tip will be greatly appreciated.

    Hong
  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 27 Jan 2014 Link to this post

    Hi Hong,

    Thank you for contacting us. Could you please send us a sample project helping us reproduce the issue at our end? Code snippets are fine as well. Thank you in advance for your cooperation.

    Regards,
    Kiril Stanoev
    TelerikIf you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
  3. DevCraft banner
  4. Hong
    Hong avatar
    15 posts
    Member since:
    Dec 2012

    Posted 28 Jan 2014 in reply to Kiril Stanoev Link to this post

    To debug this, I created a simple page with nothing but RadTextBox added to the page that was automatically created by VS2012.  I use Telerik Control Panel to ensure that I have the latest packages.  The page is the following:

    <phone:PhoneApplicationPage xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives" 
        x:Class="MyApp.Debug"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
        xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        FontFamily="{StaticResource PhoneFontFamilyNormal}"
        FontSize="{StaticResource PhoneFontSizeNormal}"
        Foreground="{StaticResource PhoneForegroundBrush}"
        SupportedOrientations="Portrait" Orientation="Portrait"
        mc:Ignorable="d"
        shell:SystemTray.IsVisible="True">

        <!--LayoutRoot is the root grid where all page content is placed-->
        <Grid x:Name="LayoutRoot" Background="Transparent">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <!--TitlePanel contains the name of the application and page title-->
            <StackPanel Grid.Row="0" Margin="12,17,0,28">
                <TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
                <TextBlock Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
            </StackPanel>

            <!--ContentPanel - place additional content here-->
            <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
    <Controls:RadTextBox />
            </Grid>
        </Grid>
    </phone:PhoneApplicationPage>

    The designer windows shows the following error:


    Exception: Error HRESULT E_FAIL has been returned from a call to a COM component.
    StackTrace
       at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
       at MS.Internal.XcpImports.Collection_InsertValue[T](PresentationFrameworkCollection`1 collection, UInt32 index, CValue value)
       at MS.Internal.XcpImports.Collection_InsertDependencyObject[T](PresentationFrameworkCollection`1 collection, UInt32 index, DependencyObject value)
       at System.Windows.PresentationFrameworkCollection`1.InsertDependencyObject(Int32 index, DependencyObject value)
       at System.Windows.Controls.UIElementCollection.InsertInternal(Int32 index, UIElement value)
    InnerException: None




  5. Hong
    Hong avatar
    15 posts
    Member since:
    Dec 2012

    Posted 28 Jan 2014 in reply to Hong Link to this post

    Everything appears to be fine now.  Here is what I did:
    1. Delete all Telerik references of the project.
    2. Add a Telerik control by drag&drop.  This will add the correct reference automatically.
    3. The error remains after step 2. Restart VS2012, and open the page with the Telerik control. The error is gone.

    The error suddenly appeared again after I deleting a non-Telerik control of the page.  I restarted VS2012, and the error is gone.  My hunch is the following:
    1. After updating the Telerik package, delete Telerik references of every project using Telerik controls, and add them back using the correct components.
    2. Restart VS whenever the error occurs. 
  6. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 29 Jan 2014 Link to this post

    Hi Hong,

    Thank you for the follow up. Sounds like a strange issue which we have not encountered before. We'll investigate the issue. In the meantime, if you have more details on the topic, let us know.

    Regards,
    Kiril Stanoev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
  7. Manoj
    Manoj avatar
    1 posts
    Member since:
    Jun 2013

    Posted 08 Mar 2014 Link to this post

    Thanks Hong
    Restarting vs solved this problem. 
  8. Hong
    Hong avatar
    15 posts
    Member since:
    Dec 2012

    Posted 25 Jul 2014 Link to this post

    Though restarting VS always solves the problem, but I have to restart VS2013 many times every day just for the sake of addressing this issue.
  9. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 30 Jul 2014 Link to this post

    Hello Hong,

    you can simplify the process for restarting by restarting only the Xaml designer. Since Xaml designer is now separate process from VS is some occasions they does not synchronize correctly. Try closing "Microsoft Visual Studio XAML UI Designer" (XDesProc.exe) process  from Taskbar. This will force the designer process to restart.

    Regards,
    Tsvyatko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner