Lainkes 0 Posted October 5, 2022 Hello, I have a DBGrid with records. On column contains a True of False value. Now I want this to be changed into a green icon (True) of red icon (False). And when clicking on the icon, it must be changed from T to F or F to T. Any idea how I can achieve this? Thanks Lainkes Share this post Link to post
PeterBelow 239 Posted October 5, 2022 3 hours ago, Lainkes said: Hello, I have a DBGrid with records. On column contains a True of False value. Now I want this to be changed into a green icon (True) of red icon (False). And when clicking on the icon, it must be changed from T to F or F to T. Any idea how I can achieve this? Thanks Lainkes Handle the OnDrawColumnCell event of the grid, in it call DefaultDrawColumnCell if the cell you are asked to draw is not one in the boolean column, draw the icon on the grid canvas if it is in your special column. The OnCellClick event fires on a mouse click on the cell. The attached dataset's current record is already set to the record shown in the row clicked on, so just change the field value if the click lands on your boolean cell. 1 Share this post Link to post
Fr0sT.Brutal 900 Posted October 10, 2022 Or use a more advanced grid that can display custom icons for boolean fields Share this post Link to post