I want to show popup button or fancy message (with coloured background, etc) just under right-bottom corner of particular cell of the current row.
For now I only figured how to get grid coordinates:
x = DBGrid.DataSource.DataSet.RecNo
y = DBGrid.Columns[index]
There is also TCustomGrid.CellRect, which would do what I want, but it's protected and I don't want to inherit and create another component class.
One crazy workaround I can think of is to save TRect-s in onDrawColumnCell event to some array.
So, what do you think ?
EDIT
How do I get screen coordinates of, say, second cell in the current row ?
RecNo
doesn't necessarily mean anything; index order can affect row ordering,Columns[Index]
gives you column but not row, and saving coordinates inOnDrawColumnCell
won't help, as it has no relationship to the current row in the grid except during the time the cell is being drawn. (I don't have a solution to offer (yet), but I can see the flaws in what you're thinking about doing.) – Rung