war doch die dummheit... habs so hinbekommen wie es RaSoWa1 gepostet hat (vielen dank nochmal)...
allerdings hab ich jetzt noch das problem das die markierte zeil falsch dargestellt wird, d.h. der text ist hier wieder doppelt...
kann man das auch noch abfangen z.b. über State???
anbei mein aktueller source:
Delphi-Quellcode:
procedure Tmain_form.strgrid_dataDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
var
iPos : Integer;
s : String;
begin
If (strgrid_data.DrawingStyle = gdsGradient) And (gdFixed in State) Then
Begin
If Not(goFixedVertLine In strgrid_data.Options) Then inc(Rect.Right);
If Not(goFixedHorzLine In strgrid_data.Options) Then inc(Rect.Bottom);
If (gdHotTrack In State) Or (gdPressed In State) Then
Begin
If (gdPressed in State) Then
Begin
GradientFillCanvas(strgrid_data.canvas, strgrid_data.GradientEndColor, strgrid_data.GradientStartColor, Rect, gdVertical)
End Else
Begin
GradientFillCanvas(strgrid_data.canvas, GetHighlightColor(strgrid_data.GradientStartColor), GetHighlightColor(strgrid_data.GradientEndColor), Rect, gdVertical);
End;
End Else
Begin
GradientFillCanvas(strgrid_data.canvas, strgrid_data.GradientStartColor, strgrid_data.GradientEndColor, Rect, gdVertical);
End;
strgrid_data.canvas.Brush.Style := bsClear;
End Else
Begin
strgrid_data.canvas.FillRect(Rect);
End;
s := strgrid_data.Cells[ACol, ARow];
//=== Column Title ===========================================================
If ARow = 0 Then
Begin
strgrid_data.Canvas.Font.Style := [fsBold];
strgrid_data.Canvas.Font.Size := 9;
DrawText(strgrid_data.canvas.Handle, PChar(s), Length(s), Rect, DT_SINGLELINE or DT_CENTER or DT_VCENTER);
End Else
Begin
strgrid_data.Canvas.Font.Size := 8;
DrawText(strgrid_data.canvas.Handle, PChar(s), Length(s), Rect, DT_SINGLELINE or DT_LEFT or DT_VCENTER);
End;
//============================================================================
end;