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

ImageColumn problems

1 Answer 54 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 16 Jul 2013, 05:15 PM
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

1 Answer, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 17 Jul 2013, 11:13 AM
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 >>
Tags
GridView
Asked by
ManniAT
Top achievements
Rank 2
Answers by
Vera
Telerik team
Share this question
or