Hello,
We have Delphi XE 2 with Odac 8.0.2.
We have a TCRDBGrid in a Dialog form used to display a list.
We have 4 columns in this grid.
We can sort the columns with a click on the title.
We have properties dgRowLines, dgRowSelect set to true.
when we click in the grid, we have an entire row selected.
When we sort with a click on a column, the blue line (selection) is moved to the bottom of the list, with the row.
Is it possible to keep the first line blue when we sort the lists ?
(keep the 1st line selected after a sort ?)
Thanks
TCRDBGrid selected line display after TitleClick
Hello,
For the cursor to stay on the first line after performing sorting in TCRDBGrid, you can use the CRDBGrid.OnTitleClick event in which you can call the First method:
procedure TForm1.CRDBGrid1TitleClick(Column: TColumn);
begin
OraQuery1.First;
end;
But the existing behaviour is more correct, because the cursor always stays on the selected record.
For the cursor to stay on the first line after performing sorting in TCRDBGrid, you can use the CRDBGrid.OnTitleClick event in which you can call the First method:
procedure TForm1.CRDBGrid1TitleClick(Column: TColumn);
begin
OraQuery1.First;
end;
But the existing behaviour is more correct, because the cursor always stays on the selected record.