ImageVerifierCode 换一换
格式:DOCX , 页数:15 ,大小:20.70KB ,
资源ID:24573109      下载积分:10 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/24573109.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(CXGRID控件使用说明.docx)为本站会员(b****2)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

CXGRID控件使用说明.docx

1、CXGRID控件使用说明TCXGRID 控件 :属性:ActiveLevel: 当前层BorderStyle: 窗口风格Color: 颜色FocusedView: 当前 View;Font: 字体LevelTabs:类似 PageControls头设置Captio nAIg nment:标题对齐方式Images图标Style:风格Levels:RootLevelOptio ns:层选项DetailTabsPosition:类似 PageControls头显示位置; TabsForEmptyDetails: 如果数据为空是否显示 TabsTcxGridLevel 组件 :属性:Active: 读

2、写激活该层 ;Controls: 读写指向 TCXGrid;CanBeVisible: 读取是否能设置可见 ;Count: 读取子层个数 ;Displaycaption: 读取层标题;IsMaster: 读取是否 cxgrid 的最上层 ;Items:读取层组,例:ltems0访问第一个层;Level: 读取层级数 ;VisibleCount: 读取可见层个数VisibleIndex: 读取可见索引个数VisibleItems:读取可见层组,例:Visibleltems0访问第一个可见层Caption: 读写层标题;GridView: 指定或读取该层的 Grid 显示;ImageIndex:

3、读写图标索引Options: TcxGridLevelOptions 选项DetailFrameColor: 读或写明细表格颜色DetailFramWidth: 读或写明细表格DetailTabsPosition:读或写 Tab位置,类似 PageControlsTabsStyles: 样式Tab: 读或设置 tab 样式 tabsBackground: 读或设置 tab 背景样式Visible: 读或设置是否可见方法:Add: 增加一个 Level;Levelsi.Add: 增加一个子 Level;TcxGridDBBandedTableView 组件 : 属性:BackGrou ndBit

4、m aps:背景图片选项Backgro und:背景图Ban dbackgrou nd 带背景图Ban kheader带头背景Co nte nt细节区背景filterBox: 过滤区背景footer:注脚背景group:组背景 header列头背景 preview :预览区背景Ban ds:带列表DataController: 数据控制DataSource 数据源DetailKeyFieldNames:主从表时设置细表键字段名 KeyFieldNames: 主从表时设置关键字段名 MasterKeyFieldNames主从表时设置主表键字段名 Summary:合 计组FooterSummary

5、Items 注脚定义FooterSummaryItems 组脚定义FilterBox: 过滤框CustomizeDialog是否自定义过滤条件 Positio n:过滤框显示位置Visible: 显示过滤框NavigatorButto ns:导航条设置Appe nd:增加按钮设置En abled是否禁用该按钮Visible: 是否显示该按钮Image In dex :图标 IDCancel取消按钮设置,具体设置同Append;Con firmDelete:删除时是否确认提示Delete: 具体设置同 Append;Edit: 具体设置同 Append;First: 具体设置同 Append;I

6、nsert: 具体设置同 Append;Last: 具体设置同 Append;Next: 具体设置同 Append;Filter: 具体设置同 Append;GotoBookmark: 具体设置同 Append;NextPage: 具体设置同 Append;Post: 具体设置同 Append;Prior: 具体设置同 Append;PriorPage: 具体设置同 Append;Refresh: 具体设置同 Append;SaveBookmark: 具体设置同 Append;Optio nsBehavior:行为选项AlwaysShowEditor: 是否总是显示编辑条Ban dHeader

7、Hi nts带头是否显示提示CellHi nts:单元格是否显示提示Colum nH eaderHi nts洌头是否显示提示CopyCapti on sToClipboard是否允许复制标题到剪贴板CopyPreviewToClipboard是否允许复制预览内容到剪贴板Expa ndMasterRow On DblClik:是否允许双击行显示明细FocusFirstCellO nN ewRecord新增记录时是否焦点指向第一列单元格GoToNextCellO nEn ter按回车是否自动跳到下一单元格NavigatorHi nts:是否显示导航条提示Optio nsCustomize:自定义选

8、项Ban dHidi ng:是否显示带Ba ndMov ing:是否允许拖动带ColumnFiltering: 是否允许列过滤Colum nGroupi ng:是否允许列分组ColumnHiding: 列头是否隐藏Colum nHorzSizi ng:是否允许调整列宽度ColumnMoving: 是否允许列拖动Colum nSorti ng:是否允许列排序Colum nV ertSizi ng:是否允许调整列高度DataRowSiz in g:是否允许调整数据行高度GroupBySorti ng:是否允许组排序GroupRowSiz ing是否允许调整组行高度Opti on Data:允许数据

9、操作Appending: 是否允许增加CancelOnExit: 退出时是否自动取消修改Deleting: 是否允许删除 DeletingConfirmation: 删除是否提示 Editing : 是否允许编辑 Inserting: 是否允许插入 OptionsSelection: 单元格操作 CellMultiSelect: 是否允许选择多单元格 CellSelect: 进入单元格是否选择 InvertSelect: 是否允许转换选择MultiSelect: 是否允许多行选择HideFocusRectOnExit: 移开是否隐藏焦点Un selectFocusedRecord On Exi

10、t移 开是否允许取消焦点Optio nsView:表格选项BandCap tio nsl nColu mn AlternateCaptio n是否允许在列里修改带标题 BandHeaderHeight:带头高度BandHeaderLineCount: 带头显示行数BandHeaders: 是否显示带头CellAutoHeight: 单元格是否自动高度CellTextMaxLineCount: 单元格文本最大行数ColumnAutoWidth: 列是否自动宽度DataRowHeight: 数据行高度Footer:是否允许显示注脚FooterAutoHeight: 注脚是否自动适应高度Footer

11、MultiSummaries:是否允许多注脚GridLineColor: 表格行线颜色GridLines: 显示表格行线类型GroupByBox: 是否允许拖动列到分组区进行分组GroupFooters显示组脚类型Header是否显示列头HeaderAutoHeight:列头是否自动适应高度HeaderHeight:列头高度lndicatorWidth: 是否显示左边指示条IndicatorWidth:指示条宽度Navigator: 是否显示导航条NavigatorOffSet: 导航条偏移位置ShowColumnFilterButtons: 是否显示列过滤按钮ShowEditButtons:

12、 是否显示编辑按钮Preview:预览选项AutoHeight: 是否自动适应高度Colu mn:要预览的列,只能选一列LeftIndent: 左缩进点数MaxLineCount: 最大显示行数Right Indent:右缩进点数Visible: 预览是否可见PopupMe nu弹出菜单Styles样式或风格组BackGrou nd:背景风格Co ntent:明细风格Footer:注脚风格Group:组风格GroupSummary组合计区风格Header头风格In dicator:指示区风格Preview:预览区风格Selectio n选择区风格StyleSheet风格组,选中后自动设置各区风

13、格方法或函数:CreateColu mn:参数:无;功能:新建一列; 返回:返回列类型结果 ;GetColumnByFieldName:参数:字段名串; 功能:取得指定字段列 ; 返回:返回列类型结果 ;例: MyTV.GetColumnByFieldName(First).Visible := False; CleaarItems:参数:无; 功能:清除全部显示列 ; 返回:无CreateItem:参数:无; 功能:建一显示列 ; 返回:列类型值StoreToIniFile:导出布局到Ini文件StoreToRegistry导出布局到注册表StoreToStream导出布局到流体Restor

14、eFromIniFile:从 Ini 文件恢复布局 RestoreFromRegistry从注册表恢复布局 RestoreFromStream从流体恢复布局FindItemByID: 根据 ID 号查找列Fin dltemByName:根据列名查找列FindItemByTag:根据 Tag 查找列In dexofItem:返回列的序号CreateViewI nfo:建表格TCXGRID 用法指南假设已设定以下变量MycxGrid: TcxGrid;MycxGridLevel: TcxGridLevel;MyTV: TcxGridDBTableView;MyDataSource: TDataSo

15、urce;方法:建层和层视图MycxGrid := TcxGrid.Create(self);MycxGridLevel := MycxGrid.Levels.Add; / 建层MyTV:= TcxGridDBTableView(MycxGrid.createview(TcxGridDBTableView);/ 建视图MycxGridLevel.Control := MycxGrid;/ 指定关系MycxGridLevel.GridView := MyTV;/ 指定视图 TcxGridDataController(GetDetailDataController(FocusedRecordInd

16、ex, 0).GridView;/ 得 到下层视图二、设定表格位置和大小MycxGrid.ParentWindow := self.Handle;MycxGrid.Top := 0;MycxGrid.Height := 200;MycxGrid.Width := 400;MyTV .Preview.visible := true;三、 设定数据源及分配全部字段MyTV .DataController.DataSource := MyDataSource;MyTV .DataController.DeleteAllItems; /清除全部字段MyTV .DataController.Create

17、AllItems; /建全部显示字段四、 动态增加显示列及列访问variIndex: integer;vCol: TcxGridDBColumn;vImgCom: TcxImageComboBoxItem;i,j: integer;for i:= 0 to Mydatasource.dataset.FieldCount -1 dobeginvCol := MyTV .CreateColumn; vCol.DataBinding.FieldName:=Mydatasource.dataset.Fieldsi.FieldName;if (i = 1) thenbeginvCol.Propertie

18、sClassName := TcxImageComboBoxProperties; / 分区分大小写 vCol.DataBinding.ValueType := String;for j := 0 to 5 dobegin vImgCom:=TcxImageComboBoxProperties(vCol.Properties).Items.Add; vImgCom.Description := IntToStr(j);vImgCom.Value := IntToStr(j);end;end;end;showmessage(MyTV.Columns0.Caption);/ 列标题访问showme

19、ssage(MyTVColum nsO.DataBi ndi ng.FieldName);/ 列字段名访问MyTV .Columns0.SortIndex := 0;MyTV .ColumnsO.SortOrder := soAscending; /列升序排序MyTV .ColumnsO.SortIndex := -1;MyTV .ColumnsO.SortOrder := soNone; /取消列排序MyTV.DataController.Search.Locate(MyTV.GetColumnByFieldName(FieldName).Index, 查 找值);/ 列值搜索MyTV .D

20、ataController.FocusedRowIndex := MyTV .DataController.FocusedRowIndex - 1;/记 录回翻,即 Prior;DBView.DataController.FocusedRowIndex := DBView.DataController.FocusedRowIndex + 1;/记录后翻 ,即 Next;Aa:=MyTV .datacontroller.values1,1 ;/ 访问第二行第二列的值MyTV.ColumnsO.DataBinding.ValueTypeClass := TcxStringValueType;设置列

21、字段类型, 其他如整型TcxlntegerValueType浮点型TcxFIoatValueType;/设置列风格:MyFirstColumnStyle := TcxStyle.Create(Self);MyFirstColumnStyle.Color := clAqua;MyFirstColumnStyle.TextColor := clBlue;MyTV.Columns1.Styles.Content := MyFirstColumnStyle;/设置列下拉框选择列表及类型varA:TDataSource:B:TcxlookupcomboboxProperties;beginA:=TDat

22、aSource.create(self);B:=tcxlookupcomboboxproperties.create(self);A.Dataset:=Dic_ry_xb; 此处指定数据源。B.listdource:=A;此处指明字段的 listsource属性。B.keyfieldnames:=a; /此处指明字段的关键字段B.listfieldnames:=b; /此处指明字段的返回值。B.listcolumns.itemsO.caption:=x; /此处默认是会建立一个字段,但是显示的表头 是name,所以此处让它显示为自己想要的中午显示。MYTVc1_sex_code.Propert

23、ies:=B; /此处指明是那个字段。end;五、 设置列外观MyTV.OptionsView.ColumnAutoWidth := true /列自动宽度MyTV.OptionsView.CellAutoHeight := true /单元自动高度MyTV .OptionsView.Footer := true /表格合计行显示MyTV .OptionsView.Header := true / 表格头显示MyTV .OptionsView.Indicator := true /显示指示条MyTV .OptionsView.GroupByBox:=true /显示分组框MyTV .Previ

24、ew := True /显示预览区六、 设置表格样式var MyStyleSheet:TcxGridTableViewStyleSheet;MyStyle :TcxStyle;beginMyStyleSheet := TcxGridTableViewStyleSheet.Create();MyStyle := TcxStyle.Create(self);MyStyle.Color := clBlack;MyStyle.TextColor := clWrite;MyTV .Styles.Background := MyStyle; /设置背景样式MyStyleSheet .A ddStyles(

25、MyStyle);/ 分配样式 cxStyleRepository.CreateStyleSheet(MyStyleSheet);MyTV.Styles.StyleSheet := cxStyleRepository; /分/ 配样式 End;七、 设置 Preview 列前提条件是设置 footer=true;设置预览列最大显示行数显示左缩进显示右缩进MyTV.Preview.colu mn := MyTVFieldl;/ 设置预览列MyTV.Preview.MaxLineCount := 4;/MyTV.Preview.LeftIndent :=150; /MyTV.Preview.Rig

26、htIndent :=150;/八、 Footer 设置Var ASummary: TcxDataSummary;MyFooterItems :TcxDataFooterSummaryItems; Acolumn :TcxGridDBColumn;ASummary := MyTV .DataController.Summary; /提取 Footer;MyFooterItems := ASummary.FooterSummaryItems; /提/ 取 FooterItems;/增加 FooterItemsWith TcxGridDBTaleSummaryItem(MyFooterItems.

27、add) doBegintryTryBeginupdate;Column := TcxGridDBColumn(MyTV .VisibleColumns0; /Footer 显示列位置 AColumn := TcxGridDBColumn(MyTV .VisibleColumns0;If assigned(AColumn) thenFieldName := AColu mn .dataBi ndi ng.FieldName; /Footer 计算字段Kind := TcxSummaryKind(skSum);/skNo门6=无.skSum计;skMax=取最大值,/skCount二记录数,sk

28、Average=均数FinallyEndupdate;End;ExceptShowmessage(error);MyFooterltems.ltemsMyFooterltems.Cou nt-1.Free;报错释放刚加入的End;End;/删除 FooterltemsMyFooterltems := TcxGridDBTableSummaryltem(MyFooterltems0);lf MyFooterltems.FieldByNamethenFor i:= 0 to MyTV.VisibleColumnCount -1 doBeginAColumn := TcxGridDBColumn(M

29、yTV .VisibleColumnsi);lf AColumn.DataBinding.FieldName = MyFooterltems.FieldName thenBreak;End;lf Assigned(MyFooterltems.Column) thenMyFooterltems.ltems0.Free;九、 建 BandVar MyBand : TcxGridBand;MyBandViewlnfo: TcxGridbandViewlnfo;MyBand := MyTV.Bands.Add;MyBand.Caption : =新建带;MyBandViewlnfo:= MyTV .V

30、iewlnfo.HeaderViewlnfo.BandsViewlnfoMyBand.visiblelndex;MyTV.Controller.LeftPos := MyBandViewlnfo.Bounds.right;十、 主从表明细嵌套关联设置MyTV.DetailKeyFieldNames := mastered; /主表关键列MyTV.KeyFieldNames := lD; /子表对应关键列MasterKeyFieldNames := ID;/ 子表自己的关键列子表 ADOQUERY 的 indexFieldNames := mastered;十一、组设置MyTV.DataCo ntroller.Groups.FullExpa nd;/组 展开MyTV.DataC on troller.Groups.Collapse;/组收缩十二、记录操作MyTV .Dataco ntroller Appe nd;/增加记录MyTV .Dataco ntrollernsert;/插入记录MyTV .Dataco ntroller.Values0.1:=a; 单元格赋值MyTV .Dataco ntroller.Ca nc

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1