Jump to content

Recommended Posts

Posted

Hi,

 

I would like to do some more drawing on the Cell in TUniStringGrid.

For example, I would like to draw a Border around a Cell if it has a specific value, or to draw a small rectangle in it.

 

How can we do that??

 

Ricahrd

 

Posted

You can just control the text style, if you want to draw a border it is more complicated than you think, it is web not desktop.

Posted

Hi,

 

Hi,

 

I would like to do some more drawing on the Cell in TUniStringGrid.

For example, I would like to draw a Border around a Cell if it has a specific value, or to draw a small rectangle in it.

 

How can we do that??

 

Ricahrd

 

You can analyze this demo example:

\FMSoft\Framework\uniGUI\Demos\Desktop\GridCellStyle

Best regards.

  • 3 years later...
Posted
On 3/16/2017 at 11:18 PM, Sherzod said:

Hi,

 

 

You can analyze this demo example:






\FMSoft\Framework\uniGUI\Demos\Desktop\GridCellStyle

Best regards.

UniDBGrid have nice event - OnFieldImage.

Can I have similar functionality in UniStringGrid?

In any way, except adding <img src="..."> tag into cells manually?

I need to render images in UniStringGrid cells.

 

And that's the difference between:

http://www.unigui.com/doc/online_help/api/uniGUITypes_TUniCellAttribs_DefaultColor.html

and 

http://www.unigui.com/doc/online_help/api/uniGUITypes_TUniCellAttribs_Color.html

?

  • 1 month later...
Posted

Do up the topic. Does it possible to draw an image inside the TUniStringGrid components? Any way is accepted. I don't want to move to the DB grid component in some locations.

I've found unclear solution here:

 

Quote

Cells[1,1] := 'img.jpg';

but don't know how to implement it.

Posted
15 minutes ago, Tokay said:

Up

You can use this solution for example.

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniStringGrid1.Cells[1, 1] := '<img src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png" height="15px" width="auto"></img>'
end;

Result:

googleLogo.png.5edb8c579efbfdfd1bac7fac34c89e74.png

  • Like 1
  • 2 weeks later...
Posted

Its very easy , just use a CSS instruction and apply it to Attribs.style in the ondrawcell event.

In the event ondrawcell just put this :

Attribs.Style.Style := 'border-bottom: 2px solid black' ;

Obvously it depends on where do you want to draw the line, how thick do you want the line and what colour.

 

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...