kentiger
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by kentiger
-
-
Ver: 1.90.0.1547 Trial
I follow the Sherzod method
Error Message: TuniCustomDBgrid.SetCellValue: RecNo Mismatch![4: -1].
Please help, thank you
How to Append A new row in Grid when VK_DOWN key pressed
in General
Posted
Hi, Hayri ASLAN
UniDbgrid1 have 3 Column
badno badname description
My needs:
When in the add mode, after the user enters the data in the Description, press the down button, the system automatically Append new record
The following is my program
procedure TMainForm.UniDBGrid1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
isLastRecord: Boolean;
begin
isLastRecord := Abs((Sender as TUniDBGrid).DataSource.DataSet.RecNo) = (Sender as TUniDBGrid).DataSource.DataSet.RecordCount;
if (Key = VK_DOWN) and (isLastRecord) and(TUniDBGrid(Sender).CurrCol=(Sender as TUniDBGrid).Columns.Count-1) then
begin
(Sender as TUniDBGrid).DataSource.DataSet.Append;
end;
end;
An error message will occur as follows-->TuniCustomDBgrid.SetCellValue: RecNo Mismatch![4: -1].
Please help, thank you