Grid View column Image Binding

8 posts, 0 answers
  1. RajaGopal
    RajaGopal avatar
    6 posts
    Member since:
    Aug 2014

    Posted 22 Sep 2014 Link to this post

    Hi,

    I have a property type if Image in the Model and i do not have path of the Image. It is designed at runtime through code.

    I need to display in GridView Column, but Rad Grid View Image column needs URL of the image to display.

    Please let me know how to bind the Image property to the grid column to display.

    Thanks
    Raja Gopal
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 22 Sep 2014 Link to this post

    Hi Raja Gopal,


    You could take a look at the following forum thread, where the same topic was discussed. 


    Regards,
    Vanya Pavlova
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. RajaGopal
    RajaGopal avatar
    6 posts
    Member since:
    Aug 2014

    Posted 22 Sep 2014 in reply to Vanya Pavlova Link to this post

    Hi Vanya,

    We are not storing the image in any physical Path, we are designing the image through code.
    So, there is no path for the Image to bind to GridViewImageColumn.
    I have a Property of Type Image, which returns BitMapImage, i want it to be displayed in one of the grid column.

    Please suggest solution.

    Thanks
    Raja Gopal

  4. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 22 Sep 2014 Link to this post

    Hello Raja Gopal,


    Thank you for getting back to us. 

    You may define a custom column and override CreateCellElement that will return return the desired image based on this type. The approach is similar to the following in the following documentation help article. 

     
    Regards,
    Vanya Pavlova
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  5. RajaGopal
    RajaGopal avatar
    6 posts
    Member since:
    Aug 2014

    Posted 22 Sep 2014 in reply to Vanya Pavlova Link to this post

    Hi,

    I have tried as followed.

     <telerik:GridViewColumn Header="Image New" >
                            <telerik:GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Image Height="50" Width="300">
                                        <Image.Source>
                                            <BitmapImage StreamSource="{Binding BoardMemoryStream}"/>
                                        </Image.Source>
                                    </Image>
                                </DataTemplate>
                            </telerik:GridViewColumn.CellTemplate>
                        </telerik:GridViewColumn>

    But, I am getting error.

      
  6. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 22 Sep 2014 Link to this post

    Hello Raja Gopal,



    What kind of an error you are currently getting?


    Regards,
    Vanya Pavlova
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  7. RajaGopal
    RajaGopal avatar
    6 posts
    Member since:
    Aug 2014

    Posted 22 Sep 2014 in reply to RajaGopal Link to this post

    I am getting following error.

    Initialization of 'System.Windows.Media.Imaging.BitmapImage' threw an exception.
  8. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 22 Sep 2014 Link to this post

    Hi Raja Gopal,


    Thank you for getting back to us.

    Using the information provided we are not able to determine what might be causing this exception by your side.

    For the time being I may suggest you to take a look at the following list of exceptions and proposed resolutions here. 


    Regards,
    Vanya Pavlova
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top