Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
Displaying image in column and enable click functionality to open file.
posted

I'm trying to display an image for a row when that row has a file (in this case a PDF) attached to it.  I have a True/False column called 'FileExists' which indicates if the row has a document associated with it.

So based on this this those rows that have a True value in the FileExists column should display an image.  I want the ability then to allow the user to click the image to open the assigned PDF file.

I have had a few attempts at this now based on other posts but can quite get it to work properly.

Any help would be most appreciated.

Troy

Parents
  • 138253
    Verified Answer
    Offline posted

    Hello Troy,

     

    Thank you for your post. I have been looking into your requirement and I created a sample project for you with the functionality you want. Basically I created a Style for the CellValuePresenter of the Boolean Field and change its ControlTemplate to has an Image and added a Converter to set different Images depending on the value of the Field. Also I bind the IsEnabled Property to the value, too, so that only the images of the records that has File can be clicked. Please let me now if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

    XamDataGridImageField.zip
Reply Children