lee576的专栏

此博内容全为自己的笔记,是写给自己看的,如果看客觉得有用,不用客气,觉得没用,也不要咒骂,抱怨,更不要找我要代码,毕竟我不是专门写给你看的...

带按钮的CxGrid

使用 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
想对作者说点什么? 我来说一句

cxGridChartView例子

2016年05月18日 1.11MB 下载

cxGrid按钮

2016年05月21日 4KB 下载

没有更多推荐了,返回首页

不良信息举报

带按钮的CxGrid

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭