Q&A

  • DBGrid관련 질문 하나....
DBGrid컬럼 별로 색을 달리 표현하고 싶은데....

이상하게 다음과 같은 Error가 발생하네여...



Incompatible types



소스좀 봐 주세여...

procedure TfrmUserDlg.DBGrid2DrawColumnCell(Sender: TObject;

const Rect: TRect; DataCol: Integer; Column: TColumn;

State: TGridDrawState);

begin

// only change colors if the cell is not being focused

if not ( gdFocused in State ) then

begin



if (DBGrid2.DataSource.DataSet.RecNo mod 2) = 0 then

DBGrid2.Canvas.Brush.Color := clWhite // even row

else

DBGrid2.Canvas.Brush.Color := clSilver; // odd row



// return all parameters back to TDBGrid for it to draw

// with our new color selections

//DBGrid2.DefaultDrawColumnCell(Rect, DataCol, Column, State);

end;



end;



0  COMMENTS