有没有办法确定多选的TStringGrid或者TCustomGrid哪些行当前被选中了,最好是有一个属性可以获取。我知道在DrawCell事件中有gdSelected属性可以设置。
我可以检查
procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState);
我可以检查
AState
的gdSelected
,并在某个数组中跟踪这个信息,但这似乎很笨拙。
TStringGrid
不支持扩展选择。(如果它支持--你怎么启用它?!) - Andreas RejbrandTStringGrid
不支持非连续选择。然而,TDBGrid
通过保持选定行的书签列表 (TDBGrid.SelectedRows
属性)来支持非连续选择。 - Ken White