Lazarus
Programming => LCL => Topic started by: SirTwist on June 23, 2019, 09:37:11 pm
-
Hi all,
I have a TStringGrid (actually a derived StringGrid...) and want to add rows to the selection by program code.
The StringGrid is configured to have Multi Ranges (RangeSelectMode = rsmMulti), that's how I try to emulate "MultiSelect" in Listboxes or ListViews.
When the user changes selection via mouse, I can read SelectedRangeCount and SelectedRange\[i\].
But I want to add rows (or cells) [edited:] to the selection ranges via code.
Is there any way to add SelectedRanges?
Kind regards,
SirTwist
-
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Grids' (#lcl)
TCustomStringGrid.InsertRowWithValues
Declaration
Source position: grids.pas line 1723
public procedure TCustomStringGrid.InsertRowWithValues(
Index: Integer;
Values: array of string
);
-
Ah, I'm sorry, my mistake. I do not want to add new rows to the StringGrid, but add rows to the selection.
-
well, you already know it :)
Selection!
Selection:TRect....
Read it to give you the selection, write it to set it.
I am going to bed, good night