Hello,
following code doesn't work as expected... gdSonglist is an advStringGrid.
While gdSongList.SelectedRowCount <> 0 do
Begin
sel:=gdSongList.SelectedRow[0];
gdSonglist.RowSelect[Sel]:=False;
gdSonglist.RemoveRows(sel,1);
End;
The first iteration works fine (SelectedRow[0] returns 10), but in the second iteration SelectedRow[0] returns 11. It should return 10 again!?
Parts of the dfm source of the grid:
object gdSongList: TAdvStringGrid
Left = 1
Top = 29
Width = 459
Height = 323
Cursor = crDefault
Margins.Right = 1
Align = alClient
BorderStyle = bsNone
Color = clWhite
ColCount = 1
Ctl3D = False
DefaultColWidth = 90
DrawingStyle = gdsGradient
FixedColor = clSilver
FixedCols = 0
RowCount = 2
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -13
Font.Name = 'Segoe UI'
Font.Style = []
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goColMoving, goRowSelect, goThumbTracking]
ParentCtl3D = False
ParentFont = False
ParentShowHint = False
PopupMenu = popMuSonglist
ScrollBars = ssNone
ShowHint = True
TabOrder = 0
DragScrollOptions.Delays.InitialDelay = 10
EnableHTML = False
EnhTextSize = True
Look = glClassic
MouseActions.DisjunctRowSelect = True
MouseActions.NoAutoRangeScroll = True
MouseActions.SelectOnRightClick = True
MouseActions.SizeFixedCol = True
MouseActions.WheelAction = waScroll
Navigation.AutoGotoWhenSorted = True
Navigation.AutoGotoIncremental = True
Navigation.AllowClipboardAlways = True
Navigation.KeepScrollOnSort = True
Navigation.LeftRightRowSelect = False
Navigation.KeepHorizScroll = True
Navigation.HomeEndKey = heFirstLastRow
ScrollType = ssMetro
ScrollHints = shVertical
SortSettings.AutoSortForGrouping = False
SortSettings.DefaultFormat = ssAutomatic
SortSettings.Column = 1
SortSettings.Show = True
SortSettings.IndexShow = True
SortSettings.IndexColor = clLime
SortSettings.AutoFormat = False
SortSettings.IgnoreCase = True
SortSettings.NormalCellsOnly = True
Version = '7.4.0.2'
WordWrap = False
RowHeights = (22
22)
Best regards
Sascha
Sascha