From: <ah...@us...> - 2009-10-25 18:20:10
|
Revision: 12577 http://jvcl.svn.sourceforge.net/jvcl/?rev=12577&view=rev Author: ahuser Date: 2009-10-25 18:20:01 +0000 (Sun, 25 Oct 2009) Log Message: ----------- Mantis #4655: JvDBGrid Auto Append Issue Modified Paths: -------------- trunk/jvcl/run/JvDBGrid.pas Modified: trunk/jvcl/run/JvDBGrid.pas =================================================================== --- trunk/jvcl/run/JvDBGrid.pas 2009-10-25 17:49:40 UTC (rev 12576) +++ trunk/jvcl/run/JvDBGrid.pas 2009-10-25 18:20:01 UTC (rev 12577) @@ -1461,7 +1461,7 @@ with DataLink.DataSet do begin DoSelection(Select, 1); - if AutoAppend and Eof and CanModify and (not ReadOnly) and (dgEditing in Options) then + if AutoAppend and Eof and CanModify and not ReadOnly and (dgEditing in Options) then Append; end; end; @@ -1477,7 +1477,8 @@ begin ACol := Col; Original := ACol; - if MultiSelect and DataLink.Active then + BeginUpdate; + try while True do begin if GoForward then @@ -1486,20 +1487,30 @@ Dec(ACol); if ACol >= ColCount then begin - ClearSelections; + if MultiSelect then + ClearSelections; + NextRow(False); ACol := IndicatorOffset; end - else - if ACol < IndicatorOffset then + else if ACol < IndicatorOffset then begin - ClearSelections; - ACol := ColCount; + if MultiSelect then + ClearSelections; + PriorRow(False); + ACol := ColCount - IndicatorOffset; end; if ACol = Original then Exit; if TabStops[ACol] then + begin + //MoveCol(ACol, 0); + SelectedIndex := ACol - IndicatorOffset; Exit; + end; end; + finally + EndUpdate; + end; end; function DeletePrompt: Boolean; @@ -1588,7 +1599,10 @@ ClearSelections else if (Key = VK_TAB) and not (ssAlt in Shift) then + begin CheckTab(not (ssShift in Shift)); + Exit; + end; end; OnKeyDown := nil; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |