|Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread|
|Messages 1 to 4 of 4 total|
|Formatting a Grid Cell or Grid Row|
|Mon, May 1 2017 9:57 AM||Permanent Link|
For a bound grid:
Is it possible to change the formatting of a grid cell based on the contents of another grid cell or another column in the underlying dataset?
If not, is it possible to do this for an unbound grid?
|Mon, May 1 2017 10:30 AM||Permanent Link|
It does seem to work for a bound grid.
I got this code in the OnCellUpdate event ('Flags' is another column in the dataset):
if FData.Columns['Flags'].AsInteger = 1 then
ACell.Font.Style.Bold := True;
And it does set the text for the relevant cell to bold.
Also when I move in the grid with up/down keys it works.
However, where it fails is when I position the selection cursor on the row which has the bold text
and highlight another row with the mouse. The result is that the row that was highlighted with the mouse
selection cursor also get the bold text.
|Mon, May 1 2017 1:45 PM||Permanent Link|
Tim Young [Elevate Software]
Elevate Software, Inc.
<< For a bound grid:
Is it possible to change the formatting of a grid cell based on the contents of another grid cell or another column in the underlying dataset? >>
No, you cannot make any assumptions about the underlying dataset. You can only use what is provided for the grid cell instance in terms of its contents. The TGrid control is virtual and grid cells can be updated for all sorts of reasons, some of which have nothing to do with the underlying dataset.
<< If not, is it possible to do this for an unbound grid? >>
|Wed, May 3 2017 5:24 PM||Permanent Link|
Wise Nutrition Coaching
<<Is it possible to change the formatting of a grid cell based on the contents of another grid cell or another column in the underlying dataset? >>
If the grid is bound to a dataset and the cell is an contains an index column then you can create a another "shadow" dataset, lookup the required values and change the formatting of the cell in the OnCellUpdate event.
It is limited in its use but I have found it useful.
This web page was last updated on
Thursday, March 30, 2023 at 10:19 AM
© 2023 Elevate Software, Inc. All Rights Reserved
Questions or comments ? E-mail us at email@example.com