Hello!
I need the user to reach the end of a grid by clicking on tab to insert a new line, automatically.
I need this line to be discarded when the user hits ESC or hits the up arrow
I need the user when entering a unidbgrid to automatically insert a blank line.
All these behaviors are common in any grid in Delphi, but I'm having a hard time implementing them in Unigui.
There are codes that deal with this in the forum like the one below, but they cause other problems and instabilities. How do I resolve this? Shouldn't these needs above be standard in Unigui?
procedure TMainForm.UniDBGrid1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
isLastRecord: Boolean;
begin
isLastRecord := (Sender as TUniDBGrid).DataSource.DataSet.RecNo = (Sender as TUniDBGrid).DataSource.DataSet.RecordCount;
if (Key = VK_TAB)and(isLastRecord)and(TUniExDBGrid(Sender).CurrCol=(Sender as TUniDBGrid).Columns.Count-1) then
begin
// your logic
(Sender as TUniDBGrid).DataSource.DataSet.Append;
end;
end;