Hi,
I have a grid set up as detailed below. The problem I am having with it is that when a row is clicked to make it the active row the grid immediately scrolls so that the newly active row is at the bottom. How can I stop the grid from scrolling like this? When I click on a row I want it become highlighted (as it does) but I want to stay in the same position rather than jumping to the bottom.
To see this in action do the following:
Place a TIWRegion on the form and a TTIWAdvWebGrid inside it. Size the grid so it just fits in the region.
Add the following FormCreate procedure:
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
var
i: Integer;
iRow: Integer;
begin
Grid1.UseFullHeight := True;
Grid1.UseFullWidth := True;
Grid1.Scroll.Style := scNever;
Grid1.ClearCells;
Grid1.TotalRows := 0;
Grid1.MouseSelect := msMove;
Grid1.Scroll.Style := scAuto;
Grid1.AsyncActiveRowMove := True;
Grid1.ActiveRowColor := $00C000;
//add some dummy data
iRow := 0;
for I := 0 to 50 do
begin
Grid1.TotalRows := Grid1.TotalRows + 1;
Grid1.Cells[0, iRow] := IntToStr(I);
Grid1.Cells[1, iRow] := IntToStr(I);
Grid1.Cells[2, iRow] := IntToStr(I);
Inc(iRow);
end;
Grid1.RowCount := Grid1.TotalRows;
end;