|Anonymous | Login | Signup for a new account||2018-12-13 10:57 CET|
|Main | My View | View Issues | Change Log | Roadmap | Docs|
|Viewing Issue Simple Details|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0004231||[JEDI VCL] 00 JVCL Components||tweak||always||2007-09-20 12:50||2007-10-12 08:46|
|Status||resolved||Product Version||Daily / GIT|
|Summary||0004231: JvDBGrid - ignores CanDelete property|
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.
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.|
Thanks, this is in SVN.
If you manage to workout the CanInsert property, please create a new issue with the changes 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|
|Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group|