This is how my drawing routine for TDBGrid component looks like. I am replacing values from database based on some rules:
void __fastcall TForm_Loadpoint_Details::DBGrid1DrawColumnCell(
TObject *Sender, const TRect &Rect, int DataCol, TColumn *Column,
TGridDrawState State)
{
int row_index = ???;
AnsiString text = GetCustomizedText(row_index, DataCol);
DrawText(text);
}
However I don't know how to tell which row is currently being rendered? Without this knowledge i can't get data for displaying.