1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| void __fastcall TFrmTableSelection::DBGrid1DrawColumnCell(TObject *Sender,
const TRect &Rect, int DataCol, TColumn *Column, TGridDrawState State)
{
if ((String) Column->FieldName == "VALIDITE_CATEGORIE")
{// on efface la cellule
DBGrid1->Canvas->FillRect(Rect);
if (Column->Field->Value.IsNull() == false)
{if ((int) Column->Field->Value != 0)
{// case cochée
ImageListCoche->Draw(DBGrid1->Canvas,
Rect.Left + ((Rect.Right - Rect.Left - ImageListCoche->Width) / 2),Rect.Top,1,true);
}
else
{// case décochée
ImageListCoche->Draw(DBGrid1->Canvas,
Rect.Left + ((Rect.Right - Rect.Left - ImageListCoche->Width) / 2),Rect.Top,0,true);
}
}
}
else
{// ce n'est pas une cellule "case à cocher"
DBGrid1->DefaultDrawColumnCell(Rect,DataCol,Column,State);
}
} |
Partager