DBGrid beautification and SQLite display problem

1 .The memo type in the DBGrid of Delphi 10.3 displays content instead of (WIDEMEMO)
a) Connect to the database and display; (the connection at design time and the connection at runtime are two independent connections, which should be distinguished)
procedure TForm1.FormCreate(Sender: TObject); begin FDQuery1.Connection := FDConnection1; FDConnection1.LoginPrompt:=false; //Cancel login prompt FDConnection1.Open(‘DriverID=SQLite;Database=test1.Sqlite3.db’); end;
b) Increase all fields;
c) Add event;
// FDQuery1UserName: TWideMemoField
procedure TForm1.FDQuery1UserNameGetText(Sender: TField; var Text: string; DisplayText: Boolean); begin Text := Copy(FDQuery1UserName.AsString, 1, 50); end;
d) Effect;
2 )DBGrid beautification
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var i: Integer; begin if gdSelected in State then Exit; // Define the font and background color of the header: for i := 0 to (Sender as TDBGrid).Columns.Count - 1 do begin (Sender as TDBGrid).Columns[i].Title.Font.Name := 'Roboto '; // Font (Sender as TDBGrid).Columns[i].Title.Font.Size := 9; // font size (Sender as TDBGrid).Columns[i].Title.Font.Color := $000000FF; // Font color (red) (Sender as TDBGrid).Columns[i].Title.Color := $0000FF00; // Background color (green) end; // Change grid background color alternately: if (Sender as TDBGrid).DataSource.DataSet.RecNo mod 2 = 0 then (Sender as TDBGrid).Canvas.Brush.Color := clInfoBk // Define background color else (Sender as TDBGrid).Canvas.Brush.Color := RGB(191, 255, 223); // Define background color // Define the color of the grid lines: TDBGrid(Sender).DefaultDrawColumnCell(Rect, DataCol, Column, State); with (Sender as TDBGrid).Canvas do // Draw the border of the cell begin Pen.Color := $00FF0000; // Define the pen color (blue) MoveTo(Rect.Left, Rect.Bottom); // Pen positioning LineTo(Rect.Right, Rect.Bottom); // Draw blue horizontal lines Pen.Color := $0000FF00; // Define the pen color (green) MoveTo(Rect.Right, Rect.Top); // Pen positioning LineTo(Rect.Right, Rect.Bottom); // Draw a green vertical line end; end;