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
Hello Troy,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
thanks Stefan that binding change worked. I also had to make a change in my MultiValueConverter class to use the ImageSourceConverter class rather than just returning a string as the image source.
new ImageSourceConverter().ConvertFromString(imagePath + "EmailReceived.png");
thanks so much.
I can suggest you change the Binding like this:
<Binding RelativeSource="{RelativeSource AncestorType={x:Type igDP:CellValuePresenter}}" Path="Record.Cells[MessageType].Value"/>
Hope this helps you.
Hi Stefan,
I've generated a sample project, in it is a SQL script to run to create the dependent table and inserts 2 rows of test data, also you will need to alter the connection string which I've hardcoded for the sample purpose.
You will single a single converter as well which also displays images which is working, as you'll see when you run the app. That one is fine, it the multi converter column I'm having the issue with, the field is called 'Direction'.
Hopefully, you can see what I'm missing.
Thansk,
Hello,
It seems like that your DataContext is set to CellValuePresenter, so you have to set the Binding's Path to Record.Cells["MessageType"].Value. If this doesn't help you, could you please send me an isolated sample project, where your issue is reproduced, so I can investigate it further for you.
Looking forward for your reply.