View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004231||JEDI VCL||00 JVCL Components||public||2007-09-20 12:50||2007-10-12 08:46|
|Platform||Delphi 5u1 EE||OS||OS Version|
|Product Version||Daily / GIT|
|Target Version||Fixed in Version||3.34|
|Summary||0004231: JvDBGrid - ignores CanDelete property|
|Description||JvDBGrid.pas, line 1512 and forth|
procedure TJvDBGrid.KeyDown(var Key: Word; Shift: TShiftState);
"VK_DELETE" case branch
what if we set CanDelete to false ?
JvDBGrid will skip this branch and pass VK_DELETE to inherited TDBGrid handler.
And will delete the row.
Instead this event should be cleared in CanDelete is False.
I also think there should be the same CanInsert property to disallow row insertion by user. This is done is a number of free 3rdparty components, so there is to be where to borrow code from :-) It would be harder than preventing Delete: at least there is one more way to insert new record by scrolling after end of table.
|Steps To Reproduce||Just set CanDelete to false, then, focused the grid, press Ctrl+Del - there would be standard VCL's pormpt for deletion, and then row would be deleted.|
|Additional Information||Personally i patched it this way (however maybe that is just ugly temporary hack)|
if CanDelete and not ReadOnly and CanModify and not
if DeletePrompt then
if SelectedRows.Count > 0 then
else Exit; //don't bubble Del into TDbGrid!
|Tags||No tags attached.|
|2007-09-20 12:50||Arioch||New Issue|
|2007-10-12 08:46||obones||Status||new => resolved|
|2007-10-12 08:46||obones||Fixed in Version||=> Daily / SVN|
|2007-10-12 08:46||obones||Resolution||open => fixed|
|2007-10-12 08:46||obones||Assigned To||=> obones|
|2007-10-12 08:46||obones||Note Added: 0013939|