Hi,
I am currently experiencing an issue with the TWebDBTableControl. It is set to page at 15 rows and has headers set on each column. The dataset loads correctly and all paging works correctly. However, if I move the underlying Dataset to the currently selected row while on a page other than the first page, the column headers disappear and are replaced with a bold version of a line of data.
IE In the following code works fine when paging:-
procedure TDeviceSchedule.ScheduleDBTableClickCell(Sender: TObject; ACol,
ARow: Integer);
var
LCurrentVisit : Integer;
LCurrentTag : string;
LCurrentRow : Integer;
LPageIndex : Integer;
LPageSize : Integer;
LRecNo : Integer;
begin
// Avoid headers and Footers
LPageIndex := ScheduleDBTable.Paging.Index;
LPageSize := ScheduleDBTable.Paging.Size;
if ARow < (LPageIndex * LPageSize) then Exit;
if ARow > ((LPageIndex * LPageSize) + LPageSize) then Exit;
// Sync dataset to the clicked row
//XDataScheduleDataSet.RecNo := ARow;
LCurrentVisit := XDataScheduleDataSet.FieldByName('VisitNumber').AsInteger;
LCurrentTag := XDataScheduleDataSet.FieldByName('GrailTag').AsString;
LblDeviceInfo.Caption := LCurrentTag;
end;
However, if the line:
//XDataScheduleDataSet.RecNo := ARow;
Is uncommented, then clicking on other rows in the table while on page 2 (for example) replaces the headers at the top with data (which I think may be the last row of the previous page).
Are there any suggestions on ways to prevent this happening and make the table behave as it should?
Thanks
Gary