begin
if DataSetBrokerPayment.DataSet.FieldByName('payment_value').AsFloat<500000 then
begin
DocViewBill.Doc.Close;
lBorders.Line := TCellSideLine.slSingle;
i:=DocViewBill.DocClassID;
if DocViewBill.DocClassID='HTZFSPD_HZ.SHEETDOC' then
TSheetDoc(DocViewBill.Doc).Sheet.Cells[3,27].Border[TCellSide.sBias1] := lBorders
else if DocViewBill.DocClassID='QTHTZFSPD_HZ.SHEETDOC' then
TSheetDoc(DocViewBill.Doc).Sheet.Cells[3,24].Border[TCellSide.sBias1] := lBorders;
DocViewBill.OpenView(TDocMode.dmEdit);
end
else
begin
DocViewBill.Doc.Close;
lBorders.Line := TCellSideLine.slNone;
i:=DocViewBill.DocClassID;
if DocViewBill.DocClassID='HTZFSPD_HZ.SHEETDOC' then
TSheetDoc(DocViewBill.Doc).Sheet.Cells[3,27].Border[TCellSide.sBias1] := lBorders
else if DocViewBill.DocClassID='QTHTZFSPD_HZ.SHEETDOC' then
TSheetDoc(DocViewBill.Doc).Sheet.Cells[3,24].Border[TCellSide.sBias1] := lBorders;
DocViewBill.OpenView(TDocMode.dmEdit);
end;
if PageControl.ActivePageIndex = 1 then
begin
ChangeType;
end;
end;
以上是在PageControlChange中的代码,当进入功能时DocViewBill.DocClassID的默认值是SBCLFKSPD_SZ.SHEETDOC,当我选中一条记录跳转到第二页的DocView时,i应该变为HTZFSPD_HZ.SHEETDOC,可结果没变,还是默认值,我想问有没有什么方法当我选中一条记录时自动更新DocView? |