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

GridViewImageColumn, TargetInvocationException

0 Answers 26 Views
GridView
This is a migrated thread and some comments may be shown as answers.
naresh
Top achievements
Rank 1
naresh asked on 03 Dec 2013, 01:55 PM
Hi Telerik,

In my application I am using telerik:GridViewImageColumn.
My scenario is I am assigning collection to gridview each object row contains the byte array of image. Collection contains more than 1000 rows.  Actually collection is for my company product users. We have few products (say 10).
I am showing those product user details in gridview with product image. Each user row contains product image byte array.
After assigning data source when I scroll the gridview sometimes getting exception “Target invocation exception”

Exception type: TargetInvocationException

Source: mscorlib

-------
-------
------

======== InnerException ========

        Description: The value should not null.

Parametername: uriSource

        Exception type: ArgumentNullException

        Source: PresentationCore

        Stack Trace:

 System.Windows.Media.Imaging.BitmapImage..ctor(Uri uriSource, RequestCachePolicy uriCachePolicy)

    Telerik.Windows.Controls.GridViewImageColumn.image_ImageFailed(Object sender, 
ExceptionRoutedEventArgs e)


My xaml code for assigning data member is

<telerik:GridViewImageColumn Header=""  UniqueName="colProductImage" DataMemberBinding="{Binding ProductImage}" ImageHeight="20" ImageWidth="20" /> 

What could be the solution for above problem?

My idea is to avoid above problem, instead of loading image byte data for each row just loads all 10 products data in one collection and give the reference to image column with collection index. If it is possible  please tell how to do .

Thanks for help. Naresh Mesineni

No answers yet. Maybe you can help?

Tags
GridView
Asked by
naresh
Top achievements
Rank 1
Share this question
or