`
znhyz1
  • 浏览: 154821 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

Delphi控件cxGrid数据录入

 
阅读更多

一、数据录入

1、 在TcxGridDBTableView中,设定属性

NewItemRow.Visible = True

 

2 、在cxgrid中输入数据怎样回车换行
    在TcxGridDBTableView中设置属性

OptionsBehavior.FocusFirstCellOnNewRecord = True 
OptionsBehavior.GoToNextCellOnEnter = True 
OptionsBehavior.FocusCellOnCycle = True 

  就可以了.如果愿意也可以添加其自带的操作按钮,OptionsView.Navigator = True随后在NavigatorButtons属性中做微调。

3 、使用TcxGridDBCardView录入时,一些属性不一样,此时除了修改OptionsBehavior中的属性值外,还要修改

OptionData.Appending=True

,同时要添加其自带的操作按钮,才行。

二、LookUp功能

1 、在cxGrid中使用LookUp功能
  在相应的列(TcxGridDBColumn)中将属性

Properties = LookupComboBox 
Properties.ListSource = 数据源 
Properties.ListFieldNames = 相应字段 
Properties.KeyFieldNames = 关键字段

也可以修改Properties.ListOptions.ShowHeader,可控制是否显示列头。

with createColumn do
begin
  Name := 'PayDetail_Id';
  Width := 1;
  HeaderAlignmentHorz := taCenter;
  HeaderAlignmentVert := vaCenter;
  Visible := false;
  tag := 0;
  PropertiesClass := TcxTextEditProperties;
  with TcxTextEditProperties(Properties) do
  begin
     Alignment.Vert := taVCenter;
     ReadOnly := true;
  end;                        
end;

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics