Jump to content

Recommended Posts

  • Administrators
Posted

In current version you can do it by directly assigning html links to Grid cells.

 

<img src="http://..." />

 

In future releases I will try to add support for images that are directly loaded from DataSet.

Posted

You must use OnDrawColumnCell event to change field value to show an images.

 

es.

 

procedure TMainForm.UniDBGrid2DrawColumnCell(Sender: TObject; ACol,

ARow: Integer; var Value: string; Column: TUniDBGridColumn;

Attribs: TUniCellAttribs);

begin

if Column.FieldName= 'foto' then

begin

Value:= '<a href="/images/'+ Value + '" target="_blank">'+ 'open' +'</a>';

end

else if Column.FieldName= 'preview' then

begin

Value:= '<img src="/images/preview.jpg">';

end

 

end;

 

 

value= image name

 

 

 

Hi Farshad,

 

is it now or in the near future possible to place images into a (db)grid?

 

Best regards

Helmut

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...