RadGrid dynamically loaded issue

3 posts, 0 answers
  1. Serrin
    Serrin avatar
    286 posts
    Member since:
    Sep 2008

    Posted 20 Nov 2008 Link to this post

    Hey again,

    So I know I saw something about this in the previous release, but it's rearing it's ugly head again.  I'm trying to split up my current application into multiple usercontrols that will all load based on user selections from a master menu.  Up to this point, MediaPlayer and Carousel are both working like a charm, but Grid... not so much. 

    I took an existing usercontrol (the original version of the app where everything was squeezed into a single usercontrol), copied the xaml down the the last bracket, and it works perfectly as far as displaying the RadGrid.  If, however, I strip out everything but the grid to make it a usercontrol that I can load dynamically in my application:

    <UserControl     
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"   
        xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
        xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"     
        x:Class="SilverLight_Intranet_Mail.radInbox" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
        xmlns:Data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"   
        Width="800" Height="350">  
        <StackPanel x:Name="LayoutRoot" Background="AliceBlue">  
            <telerikGridView:RadGridView x:Name="RGView1"                                  
                                         AutoGenerateColumns="True" 
                                         ShowGroupPanel="False" 
                                         IsFilteringAllowed="False" 
                                         ColumnBackground="WhiteSmoke" 
                                         Margin="5,5,5,5"/>  
        </StackPanel> 
    </UserControl> 

     

    I get the following error:

     

    Object reference not set to an instance of an object.  
       at MS.Internal.XcpImports.CheckHResult(UInt32 hr)  
       at MS.Internal.XcpImports.RenderTargetBitmapRender(HostingRenderTargetBitmap bitmap, UIElement visual, Int32& dirtyX, Int32& dirtyY, Int32& dirtyWidth, Int32& dirtyHeight)  
       at System.Windows.Interop.HostingRenderTargetBitmap.Render(UIElement visual)  
       at MS.Internal.Silverlight.Host.RuntimeInterop.RenderElementToTargetBitmap(Int32 elementKey, Int32 targetBitmapIdentifier)  
       at MS.Internal.Silverlight.Host.Interop.RenderElementToTargetBitmap(Int32 element, Int32 targetBitmapIdentifier, ISilverlightContentDownloadCallback urlcallback)  
       at MS.Internal.Silverlight.Host.CiderSilverlightImageHost.CiderInternalImage.UpdateBitmap()  
       at MS.Internal.Silverlight.Host.CiderSilverlightImageHost.CiderInternalImage.UpdateTree()  
       at MS.Internal.Silverlight.Host.CiderSilverlightImageHost.CiderInternalImage.MeasureOverride(Size constraint)  
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)  
       at System.Windows.UIElement.Measure(Size availableSize)  
       at System.Windows.ContextLayoutManager.UpdateLayout()  
       at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)  
       at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()  
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()  
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)  
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)  
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)  
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)  
     
     

    So I am trying to figure out why it would work with all the other stuff around it but throw an error when I isolate the grid.  The funny thing is, when you click to Reload the Designer, the grid displays for a split second before this error pops up.

    Thanks folks!!
  2. Hristo Deshev
    Admin
    Hristo Deshev avatar
    559 posts

    Posted 26 Nov 2008 Link to this post

    Hi Serrin,

    I reproduced the designer crash, and, frankly, I don't know what to say. We get a COM error raised by an unmanaged component that is close to impossible to debug. We will be researching the problem in depth and hopefully we'll get to fixing it soon.

    For the time being, I guess customers are limited to using the XAML view only.

    Greetings,
    Hristo Deshev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. Hristo Deshev
    Admin
    Hristo Deshev avatar
    559 posts

    Posted 26 Nov 2008 Link to this post

    Hi Serrin,

    By a pure stroke of luck we found the problem and fixed it. The next release will render fine in both the VS designer and Expression Blend.

    Best wishes,
    Hristo Deshev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top