带按钮的CxGrid

转载 2007年09月17日 19:53:00

使用 CxGrid 制作出类似于网页上的数据表格效果,每条记录后都能带有按钮。通过按钮去控制指定的记录。

程序截图:

关键的设置在 DFM 中:
object Form1: TForm1
   Left = 0
   Top = 0
   Caption = 'Form1'
   ClientHeight = 217
   ClientWidth = 460
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Height = -11
   Font.Name = 'Tahoma'
   Font.Style = []
   OldCreateOrder = False
   OnCreate = FormCreate
   PixelsPerInch = 96
   TextHeight = 13
   object cxGrid1: TcxGrid
     Left = 8
     Top = 8
     Width = 444
     Height = 200
     TabOrder = 0
     object cxGrid1DBTableView1: TcxGridDBTableView
       NavigatorButtons.ConfirmDelete = False
       DataController.DataSource = DataSource1
       DataController.Summary.DefaultGroupSummaryItems = <>
       DataController.Summary.FooterSummaryItems = <>
       DataController.Summary.SummaryGroups = <>
       OptionsCustomize.ColumnFiltering = False
       OptionsCustomize.ColumnGrouping = False
       OptionsView.ShowEditButtons = gsebAlways
       OptionsView.GroupByBox = False
       object cxGrid1DBTableView1name: TcxGridDBColumn
         DataBinding.FieldName = 'name'
         MinWidth = 124
         Options.Editing = False
         Options.Filtering = False
         Options.FilteringFilteredItemsList = False
         Options.FilteringMRUItemsList = False
         Options.FilteringPopup = False
         Options.FilteringPopupMultiSelect = False
         Options.Focusing = False
         Options.IgnoreTimeForFiltering = False
         Options.IncSearch = False
         Options.GroupFooters = False
         Options.Grouping = False
         Options.HorzSizing = False
         Options.Moving = False
         Options.Sorting = False
       end
       object cxGrid1DBTableView1pwd: TcxGridDBColumn
         DataBinding.FieldName = 'pwd'
         MinWidth = 124
         Options.Editing = False
         Options.Filtering = False
         Options.FilteringFilteredItemsList = False
         Options.FilteringMRUItemsList = False
         Options.FilteringPopup = False
         Options.FilteringPopupMultiSelect = False
         Options.Focusing = False
         Options.IgnoreTimeForFiltering = False
         Options.IncSearch = False
         Options.GroupFooters = False
         Options.Grouping = False
         Options.HorzSizing = False
         Options.Moving = False
         Options.Sorting = False
       end
       object cxGrid1DBTableView1Fin: TcxGridDBColumn
         DataBinding.FieldName = 'Fin'
         MinWidth = 124
         Options.Editing = False
         Options.Filtering = False
         Options.FilteringFilteredItemsList = False
         Options.FilteringMRUItemsList = False
         Options.FilteringPopup = False
         Options.FilteringPopupMultiSelect = False
         Options.Focusing = False
         Options.IgnoreTimeForFiltering = False
         Options.IncSearch = False
         Options.GroupFooters = False
         Options.Grouping = False
         Options.HorzSizing = False
         Options.Moving = False
         Options.Sorting = False
       end
       object cxGrid1DBTableView1Column1: TcxGridDBColumn
         Caption = 'Edit'
         PropertiesClassName = 'TcxButtonEditProperties'
         Properties.Buttons = <
           item
             Caption = 'Edit'
             Default = True
             Kind = bkText
             Width = 50
           end>
         Properties.ReadOnly = True
         Properties.ViewStyle = vsButtonsOnly
         Properties.OnButtonClick = cxGrid1DBTableView1Column1PropertiesButtonClick
         MinWidth = 64
         Options.Editing = False
         Options.Filtering = False
         Options.FilteringFilteredItemsList = False
         Options.FilteringMRUItemsList = False
         Options.FilteringPopup = False
         Options.FilteringPopupMultiSelect = False
         Options.Focusing = False
         Options.IgnoreTimeForFiltering = False
         Options.IncSearch = False
         Options.GroupFooters = False
         Options.Grouping = False
         Options.HorzSizing = False
         Options.Moving = False
         Options.Sorting = False
         Styles.Content = cxStyle1
       end
     end
     object cxGrid1Level1: TcxGridLevel
       GridView = cxGrid1DBTableView1
     end
   end
   object ADOConnection1: TADOConnection
     Connected = True
     ConnectionString =
       'Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security In' +
       'fo=False;User ID=sa;Initial Catalog=TestWSS;Data Source=.;Use Pr' +
       'ocedure for Prepare=1;Auto Translate=True;Packet Size=4096;Works' +
       'tation ID=TAPSH-NICHOLUS;Use Encryption for Data=False;Tag with ' +
       'column collation when possible=False'
     LoginPrompt = False
     Provider = 'SQLOLEDB.1'
     Left = 96
     Top = 152
   end
   object ADOTable1: TADOTable
     Active = True
     Connection = ADOConnection1
     CursorType = ctStatic
     TableName = 'W_User'
     Left = 128
     Top = 152
   end
   object DataSource1: TDataSource
     DataSet = ADOTable1
     Left = 160
     Top = 152
   end
   object cxStyleRepository1: TcxStyleRepository
     Left = 192
     Top = 152
     object cxStyle1: TcxStyle
       AssignedValues = [svColor, svTextColor]
       Color = clSkyBlue
       TextColor = clNavy
     end
   end
end
 

相关文章推荐

Delphi图像处理 -- 图像像素结构与图像数据转换

    《Delphi图像处理 -- 数据类型及内部过程》一文中定义了基本的图像数据类型及一些内部过程,本文进一步将Delphi常用的图像类型转换为图像处理所需的数据结构,为具体的Delphi图像处理...
  • maozefa
  • maozefa
  • 2009年10月27日 21:41
  • 7740

使用devexpress print打印cxGrid时如何自画图片与坐标转换

在一个图片管理程序中,为了提高效率,我没有把图片的资料放入DataController.Values[i]中,而是通过TcxGridBandedTableColumn.OnCustomDrawCell...

cxGrid按钮列

  • 2016年05月21日 14:43
  • 4KB
  • 下载

delphi_dev_cxgrid按钮可视态

  • 2011年05月04日 11:37
  • 301B
  • 下载

cxGrid 使用指南 3

公司目前这个项目要大量的用CxGrid,以前我从未用过,所以被逼得焦头烂额.加之我用的这电脑系统貌似有问题(老出些莫明其妙的事儿,如:突然不能编译出exe,上班开机突然丢失大堆的DLL文件,F9执行后...
  • pcent
  • pcent
  • 2012年05月13日 23:46
  • 1001

cxGrid使用技巧汇总(带目录)

  • 2013年05月09日 13:11
  • 319KB
  • 下载

Delphi CxGrid用法详解

1. 去掉cxgrid中抬头的box,在tableview1的ptionsview的groupbybox=false; 2. 在GRID footer 中加入sum(列),tableview1的op...

delphi中cxGrid使用汇总(二)

50 保存/恢复带汇总行的布局 .StoreToIniFile('c:\Grid.ini', True, [gsoUseSummary]); .RestoreFromIniFile(,True...

自画cxGrid表格(类封装)

unit UnitDevExpressVCLCustom; interface uses cxGrid, cxGridTableView, cxGridDBBandedTableView, W...

DevExpress控件cxGrid实现多列模糊匹配输入的完美解决方案

1、把列的Properties属性设置为ExtLookupComboBox。 Properties.IncrementalFiltering := False; Properties.CaseSens...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:带按钮的CxGrid
举报原因:
原因补充:

(最多只允许输入30个字)