Jump to content


Photo

Grid custom TextAfter/TextBefore on rows

grid textafter textbefore custom

  • Please log in to reply
3 replies to this topic

#1 jsvaton

jsvaton
  • Members
  • 5 posts

Posted 20 April 2014 - 01:33 AM

Hi,

i need to draw custom textafter in TnxTextColumn or add Col,Row in OnGetDrawText.
Because i have grid with values and after value need to show units. User can edit only value so TextAfter is great but now is same for all rows. I need this:

5 [kg]
7 [kg]
25 [ml]
147.5 [ml]
47 [kg]
etc.

OnGetDrawText i can't use because i don't know which fields is requested (no col, row info)
TextAfter is same for all rows.

So, is possible do that with NextGrid ?

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 21 April 2014 - 07:32 PM

Hm,

It seems that I will need to add property like PaintingCell : TPoint so you can identify currently painting cell.

In v6 I have already added ACol and ARow in OnGetText, but for v5 I will need to add this property.

I will add it now. I will release new update today/tomorrow.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 21 April 2014 - 07:40 PM

PS. Added:

procedure TForm1.NxNumberColumn1GetDrawText(Sender: TObject;
  var Text: WideString);
begin
  case NextGrid1.PaintingCell.Y of
    0: Text := Text + ' $';
    1: Text := Text + ' eur';
  end;
end;

boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#4 jsvaton

jsvaton
  • Members
  • 5 posts

Posted 22 April 2014 - 12:10 AM

Thank you very much. Work OK :)





Also tagged with one or more of these keywords: grid, textafter, textbefore, custom

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users