This is a migrated thread and some comments may be shown as answers.

Exception when setting HtmlSource

2 Answers 67 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Alan Sauls
Top achievements
Rank 1
Alan Sauls asked on 28 Dec 2009, 08:49 PM
I have downloaded the trial version of the Silverlight controls.  I am using Visual Studio 2010 and Silverlight 4.
When I add the same code that is in the provided example when I set the HtmlSource I get the following exception:

System.NullReferenceException was unhandled by user code
  Message=Object reference not set to an instance of an object.
  StackTrace:
       at Telerik.Windows.Controls.RadHtmlPlaceholder.get_RootHtmlElement()
       at Telerik.Windows.Controls.RadHtmlPlaceholder.SetContentOverflow()
       at Telerik.Windows.Controls.RadHtmlPlaceholder.OnSourceHtmlChanged()
       at Telerik.Windows.Controls.RadHtmlPlaceholder.OnSourceHtmlPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
       at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at Telerik.Windows.Controls.RadHtmlPlaceholder.set_HtmlSource(String value)
       at Bowne.XBRL.XBRLProcessor.MainPage.treeViewHeadings_SelectedItemChanged(Object sender, RoutedPropertyChangedEventArgs`1 e)
       at System.Windows.Controls.TreeView.OnSelectedItemChanged(RoutedPropertyChangedEventArgs`1 e)
       at System.Windows.Controls.TreeView.ChangeSelection(Object itemOrContainer, TreeViewItem container, Boolean selected)
       at System.Windows.Controls.TreeViewItem.Select(Boolean selected)
       at System.Windows.Controls.TreeViewItem.OnGotFocus(RoutedEventArgs e)
       at System.Windows.Controls.Control.OnGotFocus(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

Any ideas what is causing this?

2 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 29 Dec 2009, 09:39 AM
Hi Alan Sauls,

I tested your scenario and it works on our end. Please find attached project.

Let us know if there is anything specific related in your scenario.

Greetings,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Alan Sauls
Top achievements
Rank 1
answered on 29 Dec 2009, 02:58 PM
Thanks for the prompt reply.  I solved it.  Although I had set windowless to true in my aspx file in my Web project(host for Silverlight control), during debug I was generating a temp html file(the default setting) which did not have windowless set to true.  After setting this to use a permanent file that I specify, it all worked correctly.
Tags
HTMLPlaceHolder
Asked by
Alan Sauls
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Alan Sauls
Top achievements
Rank 1
Share this question
or