title: How to Draw Vertical Centered Content on DBGrid
body: <p><strong>Edited:</strong>
  I want to draw a vertical centered TIcon graphic and Text on a TJvDBGrid (Project's Jedi descendant of TDBGrid). 
  I tried to disable the DefaultDrawing method of JvDBGrid and override it, but I only could fill the cells with black (I think that my code is incomplete to do the override). </p>
  
  <p>Now I <a href="http://i.stack.imgur.com/Z1aT4.png" rel="nofollow">succeeded</a> draw the Icon on Cell and the Text remains the same with Default Drawing. How I can center the Icon (vertical and horizontal) and the Text (just vertical ), like <a href="http://i.stack.imgur.com/uD49b.png" rel="nofollow">this</a>?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>procedure TFrmXXX.JvDBGridXXXDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
  var
    Icon: TIcon;
    fixRect: TRect;
    imgWidth: Integer;
  begin
    fixRect := Rect;
  
    if Column.Index = 0  then //always the first one
    begin
      Icon := GetIcon; //Returns TIcon object
      try
        imgWidth := (Rect.Bottom - Rect.Top);
        fixRect.Right := Rect.Left + imgWidth;
        (Sender as TJvDBGrid).Canvas.StretchDraw(fixRect, Icon);
      finally
        Icon.Free;
      end;
      fixRect := Rect;
      fixRect.Left := fixRect.Left + imgWidth;
    end;
  
    (Sender as TJvDBGrid).DefaultDrawColumnCell(fixRect, DataCol, Column, State);
  end;
  </code></pre>