带按钮的CxGrid

标签: objectencryptioncollationsecuritydatasetuser
2927人阅读 评论(0) 收藏 举报
分类:

使用 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
 
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:4361874次
    • 积分:59764
    • 等级:
    • 排名:第44名
    • 原创:1198篇
    • 转载:573篇
    • 译文:7篇
    • 评论:1090条
    yes
    文章存档
    最新评论
    Asp.net