digimortal
Programmer
void __fastcall TForm1:BGrid1DrawDataCell(TObject *Sender,
const TRect &Rect, TField *Field, TGridDrawState State)
{
Query1->Prior();
double temp = Query1value2->Value;
Query1->Next();
DBGrid1->Fields[3]->Value = Query1value1->Value + temp;
}
This is something similar to what I am trying to do, Get a value from the Previous Row and do a calculation between 2 values (One from previous row and the second one from the currenct row) and write it to a field in the current field.
The code above does the calculation write it to the field that I want but DBGrid begins flickering, jump from row to row and says something like stock overflow. Is there a better way to write this code? I think it happens because of the event I use DrawDataCell but I can not solve the problem.
Thanks in advance
const TRect &Rect, TField *Field, TGridDrawState State)
{
Query1->Prior();
double temp = Query1value2->Value;
Query1->Next();
DBGrid1->Fields[3]->Value = Query1value1->Value + temp;
}
This is something similar to what I am trying to do, Get a value from the Previous Row and do a calculation between 2 values (One from previous row and the second one from the currenct row) and write it to a field in the current field.
The code above does the calculation write it to the field that I want but DBGrid begins flickering, jump from row to row and says something like stock overflow. Is there a better way to write this code? I think it happens because of the event I use DrawDataCell but I can not solve the problem.
Thanks in advance