procedure <YourForm>.<YourcxGridDBTableView>CustomDrawColumnHeader(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); var vFilterInfo: TcxGridColumnHeaderFilterButtonViewInfo; i: Integer; vSortingMarkRect:TRect; begin AViewInfo.LookAndFeelPainter.DrawHeader(ACanvas, AViewInfo.Bounds, AViewInfo.TextAreaBounds, AViewInfo.Neighbors, AViewInfo.Borders, AViewInfo.ButtonState, AViewInfo.AlignmentHorz, AViewInfo.AlignmentVert, AViewInfo.MultiLine, False, '', AViewInfo.Params.Font, AViewInfo.Params.TextColor, AViewInfo.Params.Color); ACanvas.DrawTexT(AViewInfo.Text, AViewInfo.Bounds, taCenter, vaCenter, False, False); for i := 0 to AViewInfo.AreaViewInfoCount -1 do if AViewInfo.AreaViewInfos[i] is TcxGridColumnHeaderFilterButtonViewInfo then begin vFilterInfo := TcxGridColumnHeaderFilterButtonViewInfo(AViewInfo.AreaViewInfos[i]); Break; end; vFilterInfo.Paint(ACanvas); vSortingMarkRect := vFilterInfo.Bounds; if vFilterInfo.Visible then vSortingMarkRect.Left := vSortingMarkRect.Left - vFilterInfo.Width * 2; if AViewInfo.Column.SortOrder <> soNone then Sender.Painter.LookAndFeelPainter.DrawSortingMark(ACanvas, vSortingMarkRect, AViewInfo.Column.SortOrder = soAscending); ADone := True; end; |