Page 1 of 1

(MEMO) in the DBGrid cell

Posted: Wed 21 Feb 2007 20:23
by alperozbek
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

Posted: Thu 22 Feb 2007 09:36
by Antaeus
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:

    Code: Select all

    SELECT uid, ttext + '' as ttext FROM tb_ttext;
    ttext represents the TYNYTEXT field;
    - 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:

    Code: Select all

    Text := Sender.AsString;
    - use any third party db-aware controls.