我想把dbgrid中修改的那一行反白,请问怎么做啊,在线等 待

解决方案 »

  1.   

    if 选中 then
            begin
                    dbgrid1.Canvas.Font.Color:=clred;
                    dbgrid1.Canvas.Brush.color:=clyellow;
            end
            else
            begin
                    dbgrid1.Canvas.Font.Color:=clblack;
                    dbgrid1.Canvas.Brush.color:=clWhite;
                    end;
         dbgrid1.DefaultDrawColumnCell(rect,datacol,column,state);
      

  2.   

    lvxq(吕歌) 已经给了你的思路;
      

  3.   

    在OnDRAWCELL中写。
    canavs.Brush.color:=color;
    Canavs.RectFull(Rect*TRect)
    canavs.TextOut(Rect.x,Rect.y,字)
      

  4.   

    在 DBGrid.OnDrawColumnCell 中begin
      DBGrid.Canvas.Brush.Color := DBGrid.Color;
      DBGrid.Canvas.Font.Color := clBlack;
      DBGrid.DefaultDrawDataCell(Rect, Column.Field, State);
    end;
      

  5.   

    lvxq(吕歌) 如果我是修改,那条件怎么给啊
      

  6.   

    if dbgrid.datasource.dataset.state=dsedit then