Firemonkey: styling tGrid or alternative Grid / List components (Virtual)

I am trying to create my first FireMonkey based application and I hit a wall. The only virtual list control I can find is tGrid.

This component is pretty good, but I can't figure out how to extend or customize it. I get that there is a tCheckbox column, a tImage column, etc., but what if I need a ButtonColumn or something like this?

Also, I would like to create a row based on the state of the data that it represents.

Example: if the data presented in the row has "Error = True", they should be displayed in red.

Has anyone had a similar problem? Or find alternative virtual list / grid components? Or even some tips on using the tGrid component. These components are very important in all database applications, so this should be a fairly common request.

Also as a note, I don’t think TGrid supports row dragging and dropping?

I looked at the version of VirtualTreeView from Firemonkey as well as Firemonkey and large amounts of data

+7
source share
1 answer

If you look at the sources, TCheckColumn is only 15 lines of code. If you need to create your own descendant class, this is pretty simple. This is one of the solutions, otherwise you can dynamically create some components in your cells and then drop the children when checking the details (TColumn.CellControlByRow () returns TControl, and the children will be what you put there).

How you want to “style” your string, I suggest you write your own TColumn class, even if you can draw in the OnPaint event.

+6
source

All Articles