I've not come across this before but I have a TWebDBGrid and when I set it to Edit mode it seems to go into an infinite loop in procedure TCustomStringGrid.SetRow(const Value: integer);
The problem loop is the final one
while (td.offsetTop + td.offsetHeight - pardiv.scrollTop > pardiv.offsetHeight - sh) {
pardiv.scrollTop = pardiv.scrollTop + td.offsetHeight;
}
If the cursor is on rows 1 - 4 it seems ok, but from 5 onwards it happens.
any ideas how to fix this?
I have tried using the TWebDBGrid.BeginUpdate...TWebDBGid.EndUpdate
but it's still the same
When you say: 'set it to edit mode', what exact code are you executing and from where?
I added the code:
procedure TForm1.WebButton1Click(Sender: TObject);
begin
WebDBGrid1.ShowEdit;
end;
to the demo under Demo\Basics\DBGrid
but I could not see a problem here.
There are only 2 values that can be edited, so I open a popup form and pass the two values to it. If the popup is closed with an mrOK then the dataset is edited and the updated value(s) are written:
procedure TSalesDetail.EditSalesRecord(const AIsNew: Boolean);
var
AForm: TEditSalesData;
lResult: TModalResult;
lUpdateId: Boolean;
begin
AForm := TEditSalesData.Create(Self);
try
AForm.Popup := True;
AForm.PopupOpacity := 1;
await(TEditSalesData, AForm.Load());
if not AIsNew then
begin
AForm.EditId := SalesDataDisplayId.Value;
AForm.EditAmount := SalesDataAmount.Value;
AForm.EditClaimStatus := SalesDataClaimStatus.Value;
end
else
AForm.EditClaimStatus := 'Unclaimed';
lResult := await(TModalResult, AForm.Execute);
if lResult = mrOK then
begin
SalesList.BeginUpdate;
try
if AIsNew then
begin
SalesData.Insert;
lUpdateId := True;
Self.SalesDataSheetId.Value := SalesSheetsId.Value;
SalesDataShopRef.Value := SalesSheetsShopRef.Value;
SalesDataSaleDate.Value := SalesSheetsSaleDate.Value;
SalesDataPageNum.Value := SalesSheetsSheetNumber.Value;
end
else
begin
lUpdateId := AForm.EditId <> SalesDataDisplayId.Value;
SalesData.Edit; //<-- THIS IS WHERE THE ERROR OCCURS
end;
SalesDataAmount.Value := AForm.EditAmount;
if lUpdateId then
begin
SalesDataDonorId.Value := AForm.DonorId;
SalesDataOldRef.Value := AForm.DonorRef;
SalesDataEnteredId.Value := AForm.EditId;
end;
SalesDataClaimStatus.Value := AForm.EditClaimStatus;
SalesData.Post;
finally
SalesList.EndUpdate;
end;
end;
finally
AForm.Free;
AForm := nil;
SetSalesEditButtonStates;
end;
end;
This seems to be how the grid is handled in the layout.
This is how the grid looks in Delphi

This is how the grid looks in the browser with css
and in this view anything past row 4 creates the infinite loop.
If the css is deleted then it looks like this and you can scroll to any record and edit it without a problem

So far, I could not replicate this when starting to do something similar from the demo Demo\Basics\DBGrid.
It would be helpful if you could isolate this and provide a sample source project with which we can reproduce this.
Also, is this effectively with the latest release?
It is with the latest release, but may well have been an issue previously.
The list of sample source projects I need to provide is getting longer. Just adding work arounds at the moment. In this case I'll probably just switch to a TDBWebTableControl for now.