hello everyone..
I notice that the cellValidate event in the DBadvGrid not work in the same way of advStringGrid
here my code
procedure TForm1.DBAdvGrid1CellValidate(Sender: TObject; ACol, ARow: Integer;
var Value: string; var Valid: Boolean);
var
colPrice: Integer;
price: Double;
begin
if (ACol = DBAdvGrid1.ColumnByName['colPrice2'].Index) then
Begin
if (Length(Value) > 0) then
begin
if (ADOQuery1Price.IsNull = false) then
Begin
price := StrToFloat(Value);
if (price > ADOQuery1Price.AsFloat) then
Begin
DBAdvGrid1.InvalidEntryTitle := 'valore non valido';
DBAdvGrid1.InvalidEntryText := ' non devi superare il pezzo';
Valid := false;
End;
End;
end;
end;
end;
such routine work. i mean i break in the Valid := False.. but even if i set valid=false.. the user can move in other cell.
My aim is to lock user to move other cell if the validation not pass.
may you help me??
if you want i can post project test