1 (edited by amadeus.sync 2020-04-16 18:11:03)

Topic: How to format table grid cell individually?

I'm trying to format cells individualy. What I need is how to format each cell in same column differently. Example:

frmForm1.TableGrid1.cell[6,1] is integer and I need to format like 0 + km; (integer + text1)
frmForm1.TableGrid1.cell[6,2] is integer and I need to format like 0 + l; (integer + text2)
frmForm1.TableGrid1.cell[6,3] is integer and I need to format like 0 + kg; (integer + text3)

It's not possible to do it with currency field or with TNxNumberColumn(Form1.TableGrid1.Columns[6]).FormatMask := '... '; because each cell format need to be different. Also, I created column 7 with cuurency (string: km, l, kg) but I don't know syntax to put together  integer in cell[6,y] + string in cell[7,y] so it can look like this in same cell, example:  cell[6,1] 15 km or cell[6,2] 15 l or cell[6,3] 15 kg. If this is possible, later I can hide column7.

Thanks in advance,

Vladimir

2 (edited by derek 2020-04-16 19:29:03)

Re: How to format table grid cell individually?

Hi,
The easiest (and most efficient) way would be to use a calculated field (see attached).
Derek.

Post's attachments

Attachment icon individual cell format.zip 336.85 kb, 387 downloads since 2020-04-16 

Re: How to format table grid cell individually?

derek wrote:

Hi,
The easiest (and most efficient) way would be to use a calculated field (see attached).
Derek.

This will get job done. Thanks again for your time.

Vladimir

Re: How to format table grid cell individually?

amadeus.sync wrote:
derek wrote:

Hi,
The easiest (and most efficient) way would be to use a calculated field (see attached).
Derek.

This will get job done. Thanks again for your time.

Vladimir

Hey my man, after I tested this, problem in my case is that my 'quantiy' is calculated field. Is there another solution?

Thanks.

Re: How to format table grid cell individually?

One way you can do it is to place the same calculation from your calculated field inside Derek's calculated field.

Re: How to format table grid cell individually?

Problem solved, thanks derek and ehwagner.

Vladimir