﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - NullReferenceException</title><link>http://www.intersoftsolutions.com/Community/Tags/NullReferenceException/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>NullReferenceException on most UXPage XAML files</title><link>http://www.intersoftsolutions.com/Community/Tags/NullReferenceException/</link><pubDate>Tue, 24 Feb 2015 19:00:32 GMT</pubDate><dc:creator>lawton@xogent.com</dc:creator><category>UXTEXTBOX</category><category>NullReferenceException</category><category>xaml</category><category>UXPage</category><description>After upgrading from 8.0.5000 to 10.0.5000 and persisting through 11.0.5000, most of the UXPage xaml pages in my silverlight app show the following error:&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;NullReferenceException: Object reference not set to an instance of an object.&lt;/div&gt;&lt;div&gt;StackTrace&lt;/div&gt;&lt;div&gt;&amp;nbsp; at MS.Internal.XcpImports.CheckHResult(UInt32 hr)&lt;/div&gt;&lt;div&gt;&amp;nbsp; at MS.Internal.XcpImports.FontFamily_GetFamilyName(CValue&amp;amp; element)&lt;/div&gt;&lt;div&gt;&amp;nbsp; at MS.Internal.XcpImports.ConvertCValueForManagedWithType(Type propertyType, CValue&amp;amp; outVal, Int32 outDOType, Boolean releaseObjectReference, Boolean deleteBuffer, IManagedPeerBase fromObject)&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; at MS.Internal.XcpImports.GetManagedPropertyValueFromStyle(Boolean useBuiltInStyle, IManagedPeerBase obj, DependencyProperty property, Object&amp;amp; value)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; at System.Windows.FrameworkElement.GetValueFromStyle(DependencyProperty property, Object&amp;amp; value)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; at System.Windows.DependencyObject.EvaluateBaseValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry&amp;amp; newEntry, ValueOperation operation)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; at System.Windows.DependencyObject.EvaluateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry newEntry, ValueOperation operation)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry&amp;amp; newEntry, ValueOperation operation)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty property)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; at MS.Internal.FrameworkCallbacks.InvalidateProperty(InPtr nativeTarget, UInt32 propertyId)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 13.3333330154419px;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 13.3333330154419px;"&gt;InnerException: None&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 13.3333330154419px;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 13.3333330154419px;"&gt;I have deleted the obj and bin folders.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;I have updated all references.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;If I delete a section of the XAML, and then add it back, it will show the design view again.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Any guidance?&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</description></item><item><title>How to add rows programmatically?</title><link>http://www.intersoftsolutions.com/Community/Tags/NullReferenceException/</link><pubDate>Thu, 02 Jun 2011 16:19:11 GMT</pubDate><dc:creator>mpeet</dc:creator><category>NullReferenceException</category><description>&lt;p&gt;I am new to this control.  I want to add rows to a WebGrid programmatically.  I want the WebGrid to be unbound from any database.  I want to use asp.net controls within the cells, so I am using templates.  I keep getting a NullReferenceException.&lt;/p&gt;
&lt;p&gt;Here is a simple example demonstrating my problem:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;&amp;lt;ISWebGrid:WebGrid ID="WebGrid1" Height="300px" Width="100%" UseDefaultStyle="True" runat="server" &amp;gt;
    &amp;lt;RootTable&amp;gt;
        &amp;lt;Columns&amp;gt;
            &amp;lt;ISWebGrid:WebGridColumn Name="col1" Bound="false" ColumnType="Template"&amp;gt;
                &amp;lt;CellTemplate&amp;gt;
                    &amp;lt;asp:TextBox ID="txt1" runat="server" /&amp;gt;
                &amp;lt;/CellTemplate&amp;gt;
            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
        &amp;lt;/Columns&amp;gt;
    &amp;lt;/RootTable&amp;gt;
&amp;lt;/ISWebGrid:WebGrid&amp;gt;&lt;/pre&gt;
&lt;p&gt; Code-behind:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;    protected void Page_Load(object sender, EventArgs e)
    {
        WebGrid1.InitializeRow &amp;#43;= new RowEventHandler(WebGrid1_InitializeRow);
        WebGridRow row = WebGrid1.RootTable.CreateRow();
        WebGrid1.RootTable.Rows.Add(row);
    }
    void WebGrid1_InitializeRow(object sender, RowEventArgs e)
    {
        if (e.Row.Type == RowType.Record)
        {
            WebGridRow row = (WebGridRow)e.Row;
            WebGridCellTemplateContainer cell = row.Cells[0].GetTemplateContainer();    // &amp;lt;-- always comes back null
            TextBox txt1 = (TextBox)cell.FindControl("txt1");
        }
    }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;The problem is that the call to GetTemplateContainer() always returns null and i can't figure out why.&lt;/p&gt;
&lt;p&gt;What am I doing wrong?&lt;/p&gt;
&lt;p&gt;Thanks in advance,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;
&lt;p /&gt;
&lt;p /&gt;</description></item></channel></rss>