[SOLVED] Is there a selected property for cells in a stringgrid? lazarus / 16-Databases ---------------------------------------------------------------------- wittbo · 2020-03-30 13:36 I'm looking for an easy way to count the number of selected cells in a stringgrid. Is there anything like a selected property for each cell? ---------------------------------------------------------------------- lucamar · 2020-03-30 13:57 To know if a cell is selected you can use   AGrid.IsCellSelected(x, y) If instead you want to get the range of selected cells, use   AGrid.Selection which returns a TGridRect with the coordinates of the selected "rectangle". Or, if you have multi-range selections active, you can use:   AGrid.SelectedRange[Index] along with   AGrid.SelectedRangeCount HTH! ---------------------------------------------------------------------- wittbo · 2020-03-30 18:16 Thanks, Lucamar, for this tip. Meanwhile I made a little routine for counting the selected rows (if rowselect=true). s.b. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function SelectedRowCount (theGrid: TStringGrid): Integer;var i     : Integer;    iCount: Integer;begin   iCount := 0;   for i:=0 to theGrid.SelectedRangeCount-1 do      iCount := iCount + 1 + theGrid.SelectedRange[i].Bottom - theGrid.SelectedRange[i].Top;   SelectedRowCount := iCountend;