I am using a table which has tiny text field. I want to see field values in a CRDBGrid component. But after compiling the program, there are (MEMO) text filled in the cells. I can see the right values after click on them. I added a calculated field that converts memo to string. I can see the right values in the calculated field. But are there any better way to view or edit text fields in a DBGrid? The maximum number of letters is about 20.
Thanks,
Alper ÖZBEK
(MEMO) in the DBGrid cell
We can suggest several ways to solve this problem:
- - convert column type in the table to CHAR or VARCHAR;
- convert column type to string in your query. This may look like the following:ttext represents the TYNYTEXT field;Code: Select all
SELECT uid, ttext + '' as ttext FROM tb_ttext;
- to view text fields in DBGrid, you should create all the fields of your dataset and add the following handler for the field that represents TYNYTEXT field:- use any third party db-aware controls.Code: Select all
Text := Sender.AsString;