[SOLVED] How to replace DBGrid cell display text? lazarus / 31-LCL ---------------------------------------------------------------------- Vodnik · 2023-11-20 17:49 My application uses CSVDataset and DBgrid. I would like to display text instead of integer values in some DBGrid columns, e.g. for the field 'calldirection': 'incoming' instead of 1, 'outgoing' instead of 2 and 'internal' instead of 3. When dealing with SQL database, solution is to use GetText event handler in TSQLQuery. How to obtain the same result with in-memory database, when TSQLQuery is not used? ---------------------------------------------------------------------- wp · 2023-11-20 18:43 In the same way: Assign a OnGetText handler to the field to be converted. See attachment. ---------------------------------------------------------------------- korba812 · 2023-11-20 18:45 You can still use GetText event, just you have to assign it at runtime. Eg: 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   CSVDataset1.Open;  CSVDataset1.Fields[1 {field index}].OnGetText := @MyGetTextHandler; ---------------------------------------------------------------------- Vodnik · 2023-11-20 19:16 Great thanks, @wp and @korba812!