Tips and Frequently Asked Questions
Getting checked rows in a filtered grid
In a filtered grid with a checkbox column, when you want to retrieve the rows with a selected checkbox, you need to use the real row index to get the selected state, not the display row index.
This sample code applied to a default TAdvStringGrid demonstrates this:
// initialize the grid procedure TForm1.FormCreate(Sender: TObject); begin AdvStringGrid1.SaveFixedCells := false; AdvStringGrid1.LoadFromCSV(''e:\tms\temp\cars.csv''); AdvStringGrid1.FilterDropDownAuto := true; AdvStringGrid1.FixedCols := 0; AdvStringGrid1.AddCheckBoxColumn(0); AdvStringGrid1.Options := AdvStringGrid1.Options + [goEditing]; end; // loop through all rows and for rows with a checked checkbox, add the 2nd column cell value to a listbox: procedure TForm1.Button1Click(Sender: TObject); var i:integer; state: boolean; begin for I := 1 to AdvStringGrid1.RowCount - 1 do begin AdvStringGrid1.GetCheckBoxState(0,AdvStringGrid1.RealRowIndex(i),state); if state then // add value of cell in column 2 for selected rows to the listbox listbox1.Items.Add(AdvStringGrid1.Cells[2,i]); end; end;
Pricing
Single Developer License
Small Team License
Site License
TMS VCL UI Pack
€ 375
€
150
yearly renewal
license for 1 developer
MOST POPULAR
BEST VALUE
All prices excl. VAT. Renewal price is subject to change and only valid up to 30 days after license has expired. After renewal period a discount price is offered to renew the license.
Free Trial
Note that the TMS VCL UI Pack replaces the TMS Component Pack. Both products can't be installed simultaneously. Therefore TMS Component Pack must first be uninstalled before installing the TMS VCL UI Pack