Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
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
Reporter Arioch View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
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.
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
            IsDataSetEmpty(DataLink.DataSet) then
            if DeletePrompt then
              if SelectedRows.Count > 0 then
          else Exit; //don't bubble Del into TDbGrid!
Tags No tags attached.
Attached Files

- Relationships

-  Notes
obones (administrator)
2007-10-12 08:46

Thanks, this is in SVN.
If you manage to workout the CanInsert property, please create a new issue with the changes attached.

- Issue History
Date Modified Username Field Change
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
Powered by Mantis Bugtracker