Hi,
here is a solution from e-mail communication.
You need to differentiate between document guid and attachment guid.
In this case, the field stores the file GUID of the image. To get URL of the attachment, you need to create an Url in the following format:
<domain>/getattachment/<file GUID>/<filename><extension>
To get such a Url, you can use the following method:
URLHelper.ResolveUrl(AttachmentManager.GetAttachmentUrl(attachmentGuid, fileName));
Please keep in mind that the fileName can be any string value.
For example, you can create a custom method in the code behind of the custom web part that would use the aforementioned method to get the attachment Url and then, you can call this method from the GridView's template.
More information can be found here:
Linking pages and filesExample of URL:
href='<%# "http://my.domain.com/getattachment/" + Eval("ImageGuidField") + "/FileName.aspx" %>'Best regards,
Ivana Tomanickova