用一下代码实现双页脚,第一行显示记录条数,第二条显示求和:
DBGridEh1.SumList.Active:=true;
DBGridEh1.footerrowcount:=2;
DBGrideh1.FooterColor:=clYellow;
DBGrideh1.Columns[0].Footer.ValueType :=fvtcount;
* DBGrideh1.Columns[1].Footers[0].ValueType :=fvtcount;
DBGrideh1.Columns[1].Footers[1].ValueType :=fvtSum;
但执行到有‘*’号的代码时提示'list index out of bounds(0)'错误,请问是怎么回事?
DBGridEh1.SumList.Active:=true;
DBGridEh1.footerrowcount:=2;
DBGrideh1.FooterColor:=clYellow;
DBGrideh1.Columns[0].Footer.ValueType :=fvtcount;
* DBGrideh1.Columns[1].Footers[0].ValueType :=fvtcount;
DBGrideh1.Columns[1].Footers[1].ValueType :=fvtSum;
但执行到有‘*’号的代码时提示'list index out of bounds(0)'错误,请问是怎么回事?
在设计期的话:
打开你的dbgrideh的columns editor,选择Columns[1],在object inspector里打开Columns[1]的Footers,添加两个footer,应当就可以了吧在运行期则要动态执行相应的代码乌