Hola Lenny.
La verdad es que no sé si terminé de comprender claramente la situación... De lo que entendí, no veo que relación pueda tener el evento
OnDrawColumnCell con lo que buscas hacer.
Si deseas mostrar la unión de nombre-apellido en una columna, podes hacerlo al momento de cargar el
TStringGrid desde la tabla de tu bd.
Un ejemplo de lo que te digo con la tabla CLIENTS que trae
Delphi de facto:
Código Delphi
[-]
procedure TForm1.FormCreate(Sender: TObject);
var
SG: TStringGrid;
begin
SG := StringGrid1;
SG.FixedRows := 1;
SG.RowCount := 2;
SG.ColCount := 3;
SG.ColWidths[2] := 200;
SG.Rows[0].CommaText := 'FirstName,LastName,FullName';
with Query1 do
begin
Close;
SQL.Clear;
SQL.Add('SELECT FIRST_NAME, LAST_NAME,');
SQL.Add('FIRST_NAME+'' ''+LAST_NAME AS FULL_NAME FROM CLIENTS');
Open;
while not Eof do
begin
SG.Cells[0,SG.RowCount-1] := FieldByName('FIRST_NAME').AsString;
SG.Cells[1,SG.RowCount-1] := FieldByName('LAST_NAME').AsString;
SG.Cells[2,SG.RowCount-1] := FieldByName('FULL_NAME').AsString;
SG.RowCount:= SG.RowCount + 1;
Next;
end;
end;
end;
Si deseas realizar la concatenación desde Delphi, reemplaza estas líneas:
Código Delphi
[-]
...
SQL.Text := 'SELECT FIRST_NAME, LAST_NAME FROM CLIENTS';
...
SG.Cells[2,SG.RowCount-1] := FieldByName('FIRST_NAME').AsString + ' ' +
FieldByName('LAST_NAME').AsString;
...
Resultado del ejemplo:
Saludos