browser exception

4 posts, 0 answers
  1. Colin Cowie
    Colin Cowie avatar
    10 posts
    Member since:
    May 2010

    Posted 02 Mar 2011 Link to this post

    I have a coverflow bound to an observable collection of Uri's, which works fine, except when the images cannot be loaded, because the Uri path is invalid.

    When this happens I am getting a browser exception generated in Internet Explorer as follows:

    Error: Unhandled Error in Silverlight Application
    Code: 4009    
    Category: ManagedRuntimeError       
    Message: Element is already the child of another element.     

    Handling the ImageFailed event of the Image control doesn't seem to stop this message as it does with our other display of images

    My original code was using a collection of strings (which were in effect absolute Uri's), but I have now changed the code to convert this to a collection of Uri's, and I even tried copying the xaml from your binding example incase I had something wrong there, but it still gives this error.

    The only real difference I can see is that mine is executing inside a RadWindow.  Could you let me know what I'm doing wrong and how to suppress this error message?



    Xaml below:

    <telerikNavigation:RadWindow Style="{StaticResource RadWindowStyle}" Height="Auto" Width="Auto"
        d:DesignHeight="300" d:DesignWidth="400">
            <localcore:IntPlusParameterConverter x:Key="IntPlusParameterConverter" />
            <DataTemplate x:Key="PhotoTemplate">
                <Image Source="{Binding}" Width="640" Height="480" Stretch="Uniform" telerik:RadCoverFlow.EnableLoadNotification="True" ImageFailed="Image_ImageFailed" />

        <Grid x:Name="LayoutRoot">
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            <telerik:RadCoverFlow Grid.Row="0" x:Name="PhotoFlow" Height="520" Width="1000" IsReflectionEnabled="False"
                                  ItemTemplate="{StaticResource PhotoTemplate}" />
                        Grid.Row="1" Orientation="Horizontal" SmallChange="1"
                        LargeChange="1" Minimum="0"
                        Value="{Binding ElementName=PhotoFlow, Path=SelectedIndex, Mode=TwoWay}"
                        Maximum="{Binding ElementName=PhotoFlow, Path=ItemsSource.Count, Converter={StaticResource IntPlusParameterConverter}, ConverterParameter=-1}" />



            private ObservableCollection<string> _photos;
            public ObservableCollection<string> Photos
                get { return _photos; }
                set { _photos = value; DisplayPhotos(); RaisePropertyChanged("Photos"); }

            private ObservableCollection<Uri> _PhotoUris;

            public ObservableCollection<Uri> PhotoUris
                get { return _PhotoUris; }
                set { _PhotoUris = value; }

            public PhotoDisplay()
                this.DataContext = PhotoUris;

            public void DisplayPhotos()
                PhotoUris = new ObservableCollection<Uri>();
                foreach (var _photo in Photos)
                    PhotoUris.Add(new Uri(_photo, UriKind.Absolute));
                PhotoFlow.ItemsSource = PhotoUris;

            private void Image_ImageFailed(object sender, ExceptionRoutedEventArgs e)

  2. Yana
    Yana avatar
    4986 posts

    Posted 07 Mar 2011 Link to this post

    Hi Colin Cowie,

    This is a general error which indicates that an element has two parents.
    We've tried to reproduce this issue using the provided code but to no avail. I've attached our test files for a reference.  Could you please download the attachment and try it?

    If you still experience the issue, open a support ticket and send us a sample project there. Thanks

    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. JULIO
    JULIO avatar
    3 posts
    Member since:
    Dec 2010

    Posted 24 May 2011 Link to this post

    Same error, cant find event HyperlinkButton_Click, but vs2010 marks it just like an event, no errors on building:

    private void HyperlinkButton_Click(object sender, RoutedEventArgs  e)
     { ... }

        <Grid x:Name="LayoutRoot">

        <telerikNavigation:RadCoverFlow ItemsSource="{StaticResource ControlInfoList }">









        <Border BorderBrush="{StaticResource BorderBrush}" >



        <StackPanel Style="{StaticResource PanelStyle }">



        <StackPanel Orientation ="Horizontal">


        <Image Source="{Binding Logo}" Style="{StaticResource ImageStyle }" />


        <TextBlock Text="{Binding Name}" Style="{StaticResource TitleStyle }" />


        </StackPanel >
         <HyperlinkButton Content="{Binding Texto}" NavigateUri="{Binding Liga}" click="HyperlinkButton_Click" />













  4. Yana
    Yana avatar
    4986 posts

    Posted 25 May 2011 Link to this post

    Hello Julio,

    I've attached a simple page based on your code which works as expected at our side, please download it and examine it.

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top