Jump to content

TUniStringGrid - OnDrawCell Cell Border color


rhennink

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 years later...
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

?

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 2 weeks later...

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.

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...