cxtreelist问题 cxtreelist 的列不能切换是为什么呢列的Editing, focusing全为True切换行时,编辑的列是可以修改的,只是同一行,切换列,一点反应没有,这是为什么呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 鼠标右键窗体View as Form贴出来。 object DeTree: TcxTreeList Left = 0 Top = 0 Width = 692 Height = 319 Align = alClient Bands = < item Caption.Text = 'Band1' Width = 977 end> BufferedPaint = False DragMode = dmAutomatic LookAndFeel.NativeStyle = True OptionsBehavior.AlwaysShowEditor = True OptionsBehavior.CellHints = True OptionsBehavior.AutomateLeftMostIndent = False OptionsBehavior.Sorting = False OptionsBehavior.FocusCellOnCycle = True OptionsSelection.HideFocusRect = False OptionsSelection.MultiSelect = True OptionsView.CellAutoHeight = True OptionsView.GridLines = tlglBoth OptionsView.HeaderSingleLine = True OptionsView.Indicator = True PopupMenu = PopupMenu1 TabOrder = 0 OnCustomDrawCell = DeTreeCustomDrawCell OnDragDrop = DeTreeDragDrop OnDragOver = DeTreeDragOver OnEdited = DeTreeEdited OnEditing = DeTreeEditing OnExit = DeTreeExit OnFocusedColumnChanged = DeTreeFocusedColumnChanged OnFocusedNodeChanged = DeTreeFocusedNodeChanged OnKeyPress = DeTreeKeyPress object tlcDeBh: TcxTreeListColumn PropertiesClassName = 'TcxTextEditProperties' Properties.OnValidate = tlcDeBhPropertiesValidate Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '编号' DataBinding.ValueType = 'String' Width = 87 Position.ColIndex = 0 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeMc: TcxTreeListColumn Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '名称' DataBinding.ValueType = 'String' Width = 174 Position.ColIndex = 1 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeDw: TcxTreeListColumn Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '单位' DataBinding.ValueType = 'String' Width = 49 Position.ColIndex = 2 Position.RowIndex = 0 Position.BandIndex = 0 OnGetEditProperties = tlcDeDwGetEditProperties end object tlckey: TcxTreeListColumn Visible = False DataBinding.ValueType = 'String' Width = 93 Position.ColIndex = 14 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeScj: TcxTreeListColumn PropertiesClassName = 'TcxCurrencyEditProperties' Properties.Alignment.Horz = taRightJustify Properties.DisplayFormat = ',0.0000;-,0.0000' Properties.ValidateOnEnter = True Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '市场价' DataBinding.ValueType = 'Float' Width = 75 Position.ColIndex = 3 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeCbdj: TcxTreeListColumn PropertiesClassName = 'TcxCurrencyEditProperties' Properties.ValidateOnEnter = True Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '成本价' DataBinding.ValueType = 'String' Width = 73 Position.ColIndex = 4 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeRgdj: TcxTreeListColumn PropertiesClassName = 'TcxCurrencyEditProperties' Properties.ValidateOnEnter = True Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '人工单价' DataBinding.ValueType = 'String' Width = 71 Position.ColIndex = 5 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeCldj: TcxTreeListColumn PropertiesClassName = 'TcxCurrencyEditProperties' Properties.Alignment.Horz = taRightJustify Properties.DisplayFormat = ',0.00;-,0.00' Properties.ValidateOnEnter = True Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '材料单价' DataBinding.ValueType = 'String' Width = 59 Position.ColIndex = 6 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeSbdj: TcxTreeListColumn PropertiesClassName = 'TcxCurrencyEditProperties' Properties.ValidateOnEnter = True Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '设备单价' DataBinding.ValueType = 'String' Width = 71 Position.ColIndex = 8 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeZcdj: TcxTreeListColumn PropertiesClassName = 'TcxCurrencyEditProperties' Properties.ValidateOnEnter = True Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '主材单价' DataBinding.ValueType = 'String' Width = 71 Position.ColIndex = 7 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeJxdj: TcxTreeListColumn PropertiesClassName = 'TcxCurrencyEditProperties' Properties.ValidateOnEnter = True Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '机械单价' DataBinding.ValueType = 'String' Width = 71 Position.ColIndex = 9 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeQtdj: TcxTreeListColumn PropertiesClassName = 'TcxCurrencyEditProperties' Properties.ValidateOnEnter = True Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '其他费' DataBinding.ValueType = 'String' Width = 72 Position.ColIndex = 10 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeGysm: TcxTreeListColumn PropertiesClassName = 'TcxBlobEditProperties' Properties.AlwaysSaveData = False Properties.BlobEditKind = bekMemo Properties.BlobPaintStyle = bpsText Properties.MemoScrollBars = ssBoth Properties.PictureGraphicClassName = 'TMetafile' Properties.PopupWidth = 413 Properties.ShowExPopupItems = False Properties.ShowPicturePopup = False Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '工艺说明' DataBinding.ValueType = 'String' Width = 294 Position.ColIndex = 11 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeSid: TcxTreeListColumn Visible = False Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '含量' DataBinding.ValueType = 'String' Position.ColIndex = 31 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDePid: TcxTreeListColumn Visible = False DataBinding.ValueType = 'String' Position.ColIndex = 31 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeLb: TcxTreeListColumn Visible = False Caption.Text = '节点类别' DataBinding.ValueType = 'String' Position.ColIndex = 31 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeIsNew: TcxTreeListColumn Visible = False Caption.Text = '是否新建的节点' DataBinding.ValueType = 'String' Position.ColIndex = 31 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeLrl: TcxTreeListColumn Tag = 1 PropertiesClassName = 'TcxCurrencyEditProperties' Properties.ValidateOnEnter = True Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '利润率(%)' DataBinding.ValueType = 'String' Width = 72 Position.ColIndex = 12 Position.RowIndex = 0 Position.BandIndex = 0 end object tlcDeLr: TcxTreeListColumn PropertiesClassName = 'TcxCurrencyEditProperties' Properties.ValidateOnEnter = True Caption.AlignHorz = taCenter Caption.AlignVert = vaCenter Caption.Text = '利润' DataBinding.ValueType = 'String' Width = 70 Position.ColIndex = 13 Position.RowIndex = 0 Position.BandIndex = 0 end end end end end OnEdited = DeTreeEdited OnEditing = DeTreeEditing OnFocusedColumnChanged = DeTreeFocusedColumnChanged这几个事件中,应该有什么代码影响了。比方说,被 cancel 了 或者 Handled 被设置成 true了。单单是 cxTreeList的话,没有理由不能编辑的。或许我分析的不对,你可以这样检验。代码复制一份备份。然后,把cxTreeList 一个个事件中的代码清掉再运行一下。除了 单位 那一栏不敢肯定外,其他的肯定是可以编辑的。 我怀疑楼主 Tree关系 也就是数据绑定 有错了! 一个循环插入数据的 控件移动问题 才开始学模式,自己写的一个工厂方法,大家看看,看谁能用拿去用吧 破产了,感冒了,极度难受,郁闷... 大家都进来,随便说说自己ID或中文昵称的由来 怎么安装MYSQL数据库? 在同一报表中显示两个表中的数据? 高手请进:如何从从exe的文件头取得该文件的长度? 告急!!!请问如何在Ehlib的PrintDBGridEh的属性BeforeGridText中动态增加多个值 敬请各高手指正! 如何将Excel中的数据复制粘贴到DBGridEH中? d7中如何点某按钮打开ODBC对话框设置或选择数据源
View as Form
贴出来。
Left = 0
Top = 0
Width = 692
Height = 319
Align = alClient
Bands = <
item
Caption.Text = 'Band1'
Width = 977
end>
BufferedPaint = False
DragMode = dmAutomatic
LookAndFeel.NativeStyle = True
OptionsBehavior.AlwaysShowEditor = True
OptionsBehavior.CellHints = True
OptionsBehavior.AutomateLeftMostIndent = False
OptionsBehavior.Sorting = False
OptionsBehavior.FocusCellOnCycle = True
OptionsSelection.HideFocusRect = False
OptionsSelection.MultiSelect = True
OptionsView.CellAutoHeight = True
OptionsView.GridLines = tlglBoth
OptionsView.HeaderSingleLine = True
OptionsView.Indicator = True
PopupMenu = PopupMenu1
TabOrder = 0
OnCustomDrawCell = DeTreeCustomDrawCell
OnDragDrop = DeTreeDragDrop
OnDragOver = DeTreeDragOver
OnEdited = DeTreeEdited
OnEditing = DeTreeEditing
OnExit = DeTreeExit
OnFocusedColumnChanged = DeTreeFocusedColumnChanged
OnFocusedNodeChanged = DeTreeFocusedNodeChanged
OnKeyPress = DeTreeKeyPress
object tlcDeBh: TcxTreeListColumn
PropertiesClassName = 'TcxTextEditProperties'
Properties.OnValidate = tlcDeBhPropertiesValidate
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '编号'
DataBinding.ValueType = 'String'
Width = 87
Position.ColIndex = 0
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeMc: TcxTreeListColumn
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '名称'
DataBinding.ValueType = 'String'
Width = 174
Position.ColIndex = 1
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeDw: TcxTreeListColumn
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '单位'
DataBinding.ValueType = 'String'
Width = 49
Position.ColIndex = 2
Position.RowIndex = 0
Position.BandIndex = 0
OnGetEditProperties = tlcDeDwGetEditProperties
end
object tlckey: TcxTreeListColumn
Visible = False
DataBinding.ValueType = 'String'
Width = 93
Position.ColIndex = 14
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeScj: TcxTreeListColumn
PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.Alignment.Horz = taRightJustify
Properties.DisplayFormat = ',0.0000;-,0.0000'
Properties.ValidateOnEnter = True
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '市场价'
DataBinding.ValueType = 'Float'
Width = 75
Position.ColIndex = 3
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeCbdj: TcxTreeListColumn
PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.ValidateOnEnter = True
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '成本价'
DataBinding.ValueType = 'String'
Width = 73
Position.ColIndex = 4
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeRgdj: TcxTreeListColumn
PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.ValidateOnEnter = True
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '人工单价'
DataBinding.ValueType = 'String'
Width = 71
Position.ColIndex = 5
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeCldj: TcxTreeListColumn
PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.Alignment.Horz = taRightJustify
Properties.DisplayFormat = ',0.00;-,0.00'
Properties.ValidateOnEnter = True
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '材料单价'
DataBinding.ValueType = 'String'
Width = 59
Position.ColIndex = 6
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeSbdj: TcxTreeListColumn
PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.ValidateOnEnter = True
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '设备单价'
DataBinding.ValueType = 'String'
Width = 71
Position.ColIndex = 8
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeZcdj: TcxTreeListColumn
PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.ValidateOnEnter = True
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '主材单价'
DataBinding.ValueType = 'String'
Width = 71
Position.ColIndex = 7
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeJxdj: TcxTreeListColumn
PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.ValidateOnEnter = True
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '机械单价'
DataBinding.ValueType = 'String'
Width = 71
Position.ColIndex = 9
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeQtdj: TcxTreeListColumn
PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.ValidateOnEnter = True
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '其他费'
DataBinding.ValueType = 'String'
Width = 72
Position.ColIndex = 10
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeGysm: TcxTreeListColumn
PropertiesClassName = 'TcxBlobEditProperties'
Properties.AlwaysSaveData = False
Properties.BlobEditKind = bekMemo
Properties.BlobPaintStyle = bpsText
Properties.MemoScrollBars = ssBoth
Properties.PictureGraphicClassName = 'TMetafile'
Properties.PopupWidth = 413
Properties.ShowExPopupItems = False
Properties.ShowPicturePopup = False
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '工艺说明'
DataBinding.ValueType = 'String'
Width = 294
Position.ColIndex = 11
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeSid: TcxTreeListColumn
Visible = False
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '含量'
DataBinding.ValueType = 'String'
Position.ColIndex = 31
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDePid: TcxTreeListColumn
Visible = False
DataBinding.ValueType = 'String'
Position.ColIndex = 31
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeLb: TcxTreeListColumn
Visible = False
Caption.Text = '节点类别'
DataBinding.ValueType = 'String'
Position.ColIndex = 31
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeIsNew: TcxTreeListColumn
Visible = False
Caption.Text = '是否新建的节点'
DataBinding.ValueType = 'String'
Position.ColIndex = 31
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeLrl: TcxTreeListColumn
Tag = 1
PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.ValidateOnEnter = True
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '利润率(%)'
DataBinding.ValueType = 'String'
Width = 72
Position.ColIndex = 12
Position.RowIndex = 0
Position.BandIndex = 0
end
object tlcDeLr: TcxTreeListColumn
PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.ValidateOnEnter = True
Caption.AlignHorz = taCenter
Caption.AlignVert = vaCenter
Caption.Text = '利润'
DataBinding.ValueType = 'String'
Width = 70
Position.ColIndex = 13
Position.RowIndex = 0
Position.BandIndex = 0
end
end
end
end
end
OnEditing = DeTreeEditing
OnFocusedColumnChanged = DeTreeFocusedColumnChanged
这几个事件中,应该有什么代码影响了。
比方说,被 cancel 了 或者 Handled 被设置成 true了。
单单是 cxTreeList的话,没有理由不能编辑的。或许我分析的不对,你可以这样检验。
代码复制一份备份。
然后,把cxTreeList 一个个事件中的代码清掉再运行一下。除了 单位 那一栏不敢肯定外,其他的肯定是可以编辑的。