Adding a button to DBGrid Title row at draw time lazarus / 16-Databases ---------------------------------------------------------------------- daveinhull · 2018-12-28 15:56 Hi, Could someone point me in the right direction on how to add a button to the title columns in a DBGrid (I want to add a filter button to each column) at draw time. I know how to add custom controls to fields, but can't quite figure out how to only add a control to the title row. I'm guessing it's easy, just need a pointer in the right direction, Thanks Dave ---------------------------------------------------------------------- garlar27 · 2018-12-28 16:37 Don't know if possible. The only thing I can think of is using OnDrawColumnCell to draw a Button on the title cell and OnTitleClick to implement the action. ---------------------------------------------------------------------- daveinhull · 2018-12-28 17:48 Hi garlar77, Thanks for the pointer, I'll give that a go although can't I use the OnClick event of the button to do what I need? Just one other quick question, how can I detect if it is the Title Cell, whiuch was my real query as I only know how to draw cells on all row? Thanks. ---------------------------------------------------------------------- lucamar · 2018-12-28 18:10 Quote from: daveinhull on December 28, 2018, 06:48:42 pmJust one other quick question, how can I detect if it is the Title Cell, whiuch was my real query as I only know how to draw cells on all row? Use DBGrid.CellToGridZone(). The result type is declared in grids.pas as: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type TGridZone = (  gzNormal,               gzFixedCols,            gzFixedRows,            gzFixedCells,           gzInvalid             ); ---------------------------------------------------------------------- daveinhull · 2018-12-28 18:41 Many thanks lucamar ---------------------------------------------------------------------- daveinhull · 2018-12-29 14:31 Hi, So CellToGridZone requires two parameters, Col (which I can get) and Row which I'm not sure how I get? I thought about using the dataset row, but of course that doesn't indicate a header row! Any pointers? Dave ---------------------------------------------------------------------- daveinhull · 2018-12-31 00:42 Anyone??