摘要:
dbgrideh1.footerrowcount:=1;dbgrideh1.sumlist.active:=true;每一列pDbGrid.Columns[0].Footer.ValueType:=fvtStaticText; pDbGrid.Columns[0].Footer.Value:='记录数'; pDbGrid.Columns[1].Footer.ValueType:=fvtCount;dbgrideh,displayformat #,###0.00 阅读全文
摘要:
gslb1.AutoNumberCol(0); //第0列设置为序号列gslb1.FloatingFooter.ColumnCalc[0] := acCount; //第一列统计为计数gslb1.FloatingFooter.ColumnCalc[7] := acSum; //第二列统计为求和gslb1.FloatingFooter.ColumnCalc[8] := acSum; //第二列统计为求和 阅读全文
摘要:
//聲明全局變量i procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin with DBGrid1.DataSource.DataSet do begin if DataCol = 0 then //設置在第一列 begin if state<>dsInsert then i:= recno; //這句是關鍵。。。 DBGrid1.Canvas.TextRec 阅读全文