DBGrideh 实现自动排序
一、點(diǎn)擊標(biāo)題自動(dòng)排序
1.在optioneh中設(shè)置:
AutosortMarking:=True
2.設(shè)置DbGridEh的屬性:(不一定總要設(shè)置,與使用的數(shù)據(jù)連接有關(guān))
sortlocal:=True;
3.uses 單元
Ado------ehlibADo
TclientData------ehlibCDS
BDE ---------ehlibBDE
EhLibUniDAC
4.Column屬性
ColumDefValues->Title->TitleButton設(shè)為TRUE
二、統(tǒng)計(jì)
DBGrideh1.FooterRowCount:=1;//新添加一行腳注
DBGrideh1.SumList.Active:=true;
在列屬性里:
Footers-新建ValueTypeFieldName
DBGridEh1.Columns[3].Footers.Add;
DBGridEh1.Columns[3].Footers[1].ValueType:=fvtFieldValue;//字段值
DBGridEh1.Columns[3].Footers[1].FieldName:='合同號(hào)';
DBGridEh1.Columns[3].Footers[1].Font.Style:=[fsBold];
DBGridEh1.Columns[3].Footers[1].Font.Color:=clBlue;
DBGridEh1.SumList.Active:=True;
三、鎖定:dbgrideh的frozencols設(shè)置為2
二、+序列號(hào)
總結(jié)
以上是生活随笔為你收集整理的DBGrideh 实现自动排序的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 用开源项目PhotoView实现图片的双
- 下一篇: gbg9文件怎么打开