RadHtmlPlaceholder Issue

6 posts, 1 answers
  1. Akila
    Akila avatar
    4 posts
    Member since:
    Jul 2015

    Posted 17 Jun 2018 Link to this post

    Hi,

    I'm working on a Silverlight program, which is used to display the preview of an email. Once user entered the email and clicked preview button, that message will display as a html content in preview window, which has created using a telerik RadPlaceHolder. But when click the the button it gives the following error. Can someone help me to sort out this issue. Kindly note that I'm silverlight beginner.

     

    The invocation of the constructor on type 'Telerik.Windows.Controls.RadHtmlPlaceholder' that matches the specified binding constraints threw an exception. [Line: 9 Position: 77]

     

    This is my code

    <telerik:RadWindow  x:Class="Mcs.Crm.ReportBursting.Controls.PrintPreview"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                 Width="400"
                 Height="300" HorizontalAlignment="Center" VerticalAlignment="Center">
        <Grid x:Name="LayoutRoot" Background="White">
            <Border BorderBrush="Black" BorderThickness="1">
                <telerik:RadHtmlPlaceholder x:Name="RadHtmlPlaceholder1" Margin="10"/>
            </Border>
        </Grid>
        </telerik:RadWindow >

     

    public partial class PrintPreview : RadWindow
        {
            string mHtml;
            
            public PrintPreview()
            {
                InitializeComponent();
            }
            
            public PrintPreview(string html)
            {
                try
                {
                    InitializeComponent();
                }
                catch (Exception)
                {
                    
                    throw;
                }
                
                mHtml = html;
                Loaded += new RoutedEventHandler(Page_Loaded);
            }

            private void Page_Loaded(object sender, RoutedEventArgs e)
            {
                RadHtmlPlaceholder1.HtmlSource = mHtml;
            }

     

     

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2444 posts

    Posted 18 Jun 2018 Link to this post

    Hello Akila,

    This error usually appears if there is a missing Telerik dll or the referenced Telerik dlls are of different versions. Can you double check this? And after this Clean/Rebuild the project.

    Also, you can find additional information about the error by clicking the View Details link in the exception tooltip that is shown on the line of the error.

    I hope that helps.

    Regards,
    Martin Ivanov
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Akila
    Akila avatar
    4 posts
    Member since:
    Jul 2015

    Posted 18 Jun 2018 Link to this post

    Hi Martin,

    Thank you so much for your quick response. Kindly note that I'm not that much familiar with silverlight and telerik controls. Therefore can you please refer the following details and advice me resolve this.

    Referenced  Telerik dlls

    Telerik.Windows.Controls - v4.0.30319 (2017.1.222.1050)

    Telerik.Windows.Controls.ImageEditor - v4.0.30319 (2017.1.222.1050)
    Telerik.Windows.Controls.Input - v4.0.30319 (v4.0.30319)
    Telerik.Windows.Controls.Navigation - v4.0.30319 (2017.1.222.1050)
    Telerik.Windows.Controls.RibbonView - v4.0.30319 (2017.1.222.1050)
    Telerik.windows.controls.richtextboxui - v4.0.30319 (2017.1.222.1050)
    Telerik.Windows.Data - v4.0.30319 (2017.1.222.1050)
    Telerik.windows.documents - v4.0.30319 (2017.1.222.1050)
    Telerik.Windows.Documents.Core - v4.0.30319 (2017.1.213.1050)
    Telerik.Windows.Documents.FormatProviders.Html - v4.0.30319 (2017.1.222.1050)

     

    Exception Details

    System.Windows.Markup.XamlParseException occurred
      Message=The invocation of the constructor on type 'Telerik.Windows.Controls.RadHtmlPlaceholder' that matches the specified binding constraints threw an exception. [Line: 9 Position: 77]
      LineNumber=9
      LinePosition=77
      StackTrace:
           at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
           at Mcs.Crm.ReportBursting.Controls.PrintPreview.InitializeComponent()
           at Mcs.Crm.ReportBursting.Controls.PrintPreview..ctor(String html)
      InnerException: System.Collections.Generic.KeyNotFoundException
           Message=The given key was not present in the dictionary.
           StackTrace:
                at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
                at System.Windows.ResourceManagerWrapper.GetResourceForUri(Uri xamlUri, Type componentType)
           InnerException:

     

    Thank you so much !

  4. Akila
    Akila avatar
    4 posts
    Member since:
    Jul 2015

    Posted 18 Jun 2018 in reply to Martin Ivanov Link to this post

    I Martin,

    I've installed the following toolkits. 

    Silverlight_5_Toolkit_December_2011.msi

    Telerik_UI_for_Silverlight_2017_1_222_Dev.msi

     

    Thanks

  5. Akila
    Akila avatar
    4 posts
    Member since:
    Jul 2015

    Posted 19 Jun 2018 in reply to Martin Ivanov Link to this post

    Hi Martin,

    Thank you so much for your quick response. Kindly note that I'm not that much familiar with silverlight and telerik controls. Therefore can you please refer the following details and advice me resolve this

    .
    Referenced  Telerik dlls
    Telerik.Windows.Controls - v4.0.30319 (2017.1.222.1050)
    Telerik.Windows.Controls.ImageEditor - v4.0.30319 (2017.1.222.1050)
    Telerik.Windows.Controls.Input - v4.0.30319 (v4.0.30319)
    Telerik.Windows.Controls.Navigation - v4.0.30319 (2017.1.222.1050)
    Telerik.Windows.Controls.RibbonView - v4.0.30319 (2017.1.222.1050)
    Telerik.windows.controls.richtextboxui - v4.0.30319 (2017.1.222.1050)
    Telerik.Windows.Data - v4.0.30319 (2017.1.222.1050)
    Telerik.windows.documents - v4.0.30319 (2017.1.222.1050)
    Telerik.Windows.Documents.Core - v4.0.30319 (2017.1.213.1050)
    Telerik.Windows.Documents.FormatProviders.Html - v4.0.30319 (2017.1.222.1050)

    Exception Details
    System.Windows.Markup.XamlParseException occurred
      Message=The invocation of the constructor on type 'Telerik.Windows.Controls.RadHtmlPlaceholder' that matches the specified binding constraints threw an exception. [Line: 9 Position: 77]
      LineNumber=9
      LinePosition=77
      StackTrace:
           at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
           at Mcs.Crm.ReportBursting.Controls.PrintPreview.InitializeComponent()
           at Mcs.Crm.ReportBursting.Controls.PrintPreview..ctor(String html)
      InnerException: System.Collections.Generic.KeyNotFoundException
           Message=The given key was not present in the dictionary.
           StackTrace:
                at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
                at System.Windows.ResourceManagerWrapper.GetResourceForUri(Uri xamlUri, Type componentType)
           InnerException:

    Thank you so much !

  6. Answer
    Martin Ivanov
    Admin
    Martin Ivanov avatar
    2444 posts

    Posted 21 Jun 2018 Link to this post

    Hello Akila,

    I noticed that you already opened a support ticket with the same question and the issue seems to be resolve by enabling the Windowless mode of the Silverlight application. Can you confirm this?

    Regards,
    Martin Ivanov
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top