cxTreeList,在cxTreeList1Column2设置为CheckBox,cxTreeList1Column3设置为ComboBox,cxTreeList1Column4设置为ColorComboBox ,在procedure TForm1.cxTreeList1Column2GetEditingProperties(Sender: TcxTreeListColumn; ANode: TcxTreeListNode;
var EditProperties: TcxCustomEditProperties);事件中添加如下代码:begin
// cxTreeList1.FocusedNode.Values[cxTreeList1Column2.ItemIndex]
//if pos('true',lowercase(ANode.Values[0])) <> 0 then
if pos('true',lowercase(cxTreeList1.FocusedNode.Values[cxTreeList1Column2.ItemIndex])) = 1 then
//if pos('true',lowercase(ANode.Values[cxTreeList1Column2.ItemIndex])) <> 0 then // cxTreeList1.FocusedNode
begin
ANode.ImageIndex := 1;
ANode.Values[3] := StringToColor('clLime');
// ANode.Values[cxTreeList1Column4.ItemIndex] := StringToColor('clLime');
//showmessage('t');
end; // if pos('false',lowercase(ANode.Values[0])) <> 0 then
if pos('false',lowercase(cxTreeList1.FocusedNode.Values[cxTreeList1Column2.ItemIndex])) = 1 then
begin
ANode.ImageIndex := 0;
ANode.Values[3] := StringToColor('clblue');
// ANode.Values[cxTreeList1Column4.ItemIndex] := StringToColor('clblue');
//showmessage('f');
end; end;但是image有时候不随设置变化,ColorComboBox颜色也不能跟随实时状态变化,请教如何修改代码,或改变事件能实时使image和ColorComboBox跟随设置变化?
var EditProperties: TcxCustomEditProperties);事件中添加如下代码:begin
// cxTreeList1.FocusedNode.Values[cxTreeList1Column2.ItemIndex]
//if pos('true',lowercase(ANode.Values[0])) <> 0 then
if pos('true',lowercase(cxTreeList1.FocusedNode.Values[cxTreeList1Column2.ItemIndex])) = 1 then
//if pos('true',lowercase(ANode.Values[cxTreeList1Column2.ItemIndex])) <> 0 then // cxTreeList1.FocusedNode
begin
ANode.ImageIndex := 1;
ANode.Values[3] := StringToColor('clLime');
// ANode.Values[cxTreeList1Column4.ItemIndex] := StringToColor('clLime');
//showmessage('t');
end; // if pos('false',lowercase(ANode.Values[0])) <> 0 then
if pos('false',lowercase(cxTreeList1.FocusedNode.Values[cxTreeList1Column2.ItemIndex])) = 1 then
begin
ANode.ImageIndex := 0;
ANode.Values[3] := StringToColor('clblue');
// ANode.Values[cxTreeList1Column4.ItemIndex] := StringToColor('clblue');
//showmessage('f');
end; end;但是image有时候不随设置变化,ColorComboBox颜色也不能跟随实时状态变化,请教如何修改代码,或改变事件能实时使image和ColorComboBox跟随设置变化?
在添加Node的时候,你需要指定Node的Check Group Type为CheckGroup就可以了。