Hi,
In the NextDBGrid v4.4.5
--- added: doInsDelKeys flag in DataAwareOptions property. When True, Ins key will Insert new record (DataSet.Insert). Delete key deletes record (DataSet.Delete)
But in 6.6.0 version this options is not found.
In 4.4.5 this source code:
-
procedure TNextDBGrid.KeyDown(var Key: Word; Shift: TShiftState);
-
var
-
AcceptDelete: Boolean;
-
begin
-
{ Support for Insert and Delete keys }
-
if (doInsDelKeys in FDataAwareOptions)
-
and IsDataSetActive
-
and not FDataLink.ReadOnly
-
and not(gtEdit in GridState) then
-
begin
-
case Key of
-
VK_INSERT: FDataLink.DataSet.Insert;
-
VK_DELETE:
-
begin
-
if not FDataLink.DataSet.IsEmpty then
-
begin
-
AcceptDelete := True;
-
DoDeleteRecord(AcceptDelete);
-
if AcceptDelete then FDataLink.DataSet.Delete;
-
end;
-
end;
-
VK_ESCAPE: FDataLink.DataSet.Cancel;
-
end;
-
end;
-
if not(doBufferRecords in DataAwareOptions) then
-
begin
-
case Key of
-
VK_PRIOR: SendMessage(Handle, WM_VSCROLL, SB_PAGEUP, 0);
-
VK_NEXT: SendMessage(Handle, WM_VSCROLL, SB_PAGEDOWN, 0);
-
VK_HOME: SendMessage(Handle, WM_VSCROLL, SB_TOP, 0);
-
VK_END: SendMessage(Handle, WM_VSCROLL, SB_BOTTOM, 0);
-
else inherited KeyDown(Key, Shift);
-
end;
-
end else inherited KeyDown(Key, Shift);
-
end;
Can i have INS and DEL keys the new records/delete records?.
In this version not found KeyDown method.
Thanks!