tcoates Posted November 15, 2016 Posted November 15, 2016 I am display statistics in a string grid, such that odd numbered rows contain values, and even rows contain labels, and that part works fine... and I have larger font in the "value" rows. But... 1. Is it possible to also display images in cells in a unistringgrid? 2. I would also like to center the text in the cells? (I know that it is possible in unidbgrid, but cannot see how to do it with a stringgrid component. Thanks in advance. Tim Quote
Administrators Farshad Mohajeri Posted November 15, 2016 Administrators Posted November 15, 2016 Cells can accept HTML content, so: procedure TMainForm.UniStringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; var Value: string; Attribs: TUniCellAttribs); begin if (ACol = 1) and (ARow = 1) then Value := uniImage2Url(UniImage1.Picture.Graphic, 0, 0); end; or procedure TMainForm.UniStringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; var Value: string; Attribs: TUniCellAttribs); begin if (ACol = 1) and (ARow = 1) then Value := '<img src="/files/Database.png">'; end; Quote
Sherzod Posted November 15, 2016 Posted November 15, 2016 Hi, 2. I would also like to center the text in the cells? (I know that it is possible in unidbgrid, but cannot see how to do it with a stringgrid component. For now can you try this ?!: http://forums.unigui.com/index.php?/topic/6219-cell-contents-alignment-in-unistringgrid/&do=findComment&comment=31786 Best regards. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.