ImageColumn problems

2 posts, 0 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 16 Jul 2013 Link to this post

    Hi,

    I'm not sure if this is related to this post but...
    http://www.telerik.com/community/forums/wpf/gridview/grid-not-showing-any-rows.aspx
    There I got the tip to set GroupRenderMode to flat, which helps "somehow".

    I found another issue (but I guess it's to much effort to build a proofing example).

    Another grid (working fine till one of the latest updates) is broken now.

    After loading (prior to updating) the grid I do some dispatched (priority input) work from a different thread and my application breaks with an error.
    I get a null reference exception in GridViewDataControl.cs somewhere in a PropertyChanged event handler.

    When I remove my background processing it works "somehow" - but the image GridViewImageColumn shows the file path instead of an image.
    If I open the view a second time the image is displayed.

    At design time the designer breaks with a null ref exception- the stack trace:
    Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass40.<Telerik.Windows.Data.IWeakEventListener<System.ComponentModel.PropertyChangedEventArgs>.ReceiveWeakEvent>b__3f()
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

    Maybe this helps you to track the problem.

    Just to complete this post...
    Since you (telerik) gave the tip at the other post...

    In the (open and broken designer) I enter GroupRenderMode="Flat" - and the grid displays immediately.
    This solves the problem at designtime - but unfortunately it still breaks at runtime.

    When I remove my handler it no longer breaks totally - but at the first view I see the image flicker up and then the filename.
    After I switch views I see the images.
    When I resize my window so that some rows are hidden and make it larger again - the images at the covered rows are no longer displayed.
    Resize from the other side so that the images are not covered but the rows are resized - I see (some of) them again.

    The problem really has to do something with NotifyPropertyChanged because I can make the things a lot better if the initial binding does not fire PropertyChanged.

    Let me explain - the class holds a lot of images loaded on demand.
    So there is a property "TheImage" with a getter like if(_DEFImage==null) { TryToLoadImages(); } return(_DEFImage);....

    And TryToLoadImages set the image properties (also "TheImage") through their setter, which fires NotifyPropertyChanged (which is intended).

    I I - in the constructor of my ViewModel iterate through the TheImage properties (force a load) the grid binds fine.
    BUT - the other issue (make window smaller to cover...) still exists.

    Regards
    Manfred
  2. Vera
    Admin
    Vera avatar
    263 posts

    Posted 17 Jul 2013 Link to this post

    Hello Manfred,

    Thank you for all the details. I suppose that you get a NullReferenceException in GridViewDataControl.Unloaded event. We resolved it and the fix will be part of our next Internal Build (Monday).
    As for the ImageColumn problem, we are currently investigating it and we will do our best to provide a fix as soon as possible.

    Please excuse us for the inconvenience caused. Let us know in case you experience any other issues.


    Regards,
    Vera
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top