DevExpress 中 cxTreeList 的问题,有研究过的老大进来看看,两天了还没头绪!

LngDotin 2011-09-28 04:03:27
  为了更好的显示数据的层次结构,没办法,只好用了 DevExpress 中 cxTreeList ,有其他能显示层次的非第三方控件吗?

  在 cxTreeList 中,我设置了几个列,其中有两个列的 Properties 设置成了 ComboBox ,在程序中动态给两个 ComboBox 的 Items 动态赋值,通过查阅资料,动态赋值已基本实现,代码如下:

void __fastcall TGridForm::cxTreeListColumn1GetEditingProperties(TcxTreeListColumn *Sender, TcxTreeListNode *ANode,TcxCustomEditProperties *&EditProperties)
{
TcxComboBoxProperties *ThisItem = new TcxComboBoxProperties(Application);
ThisItem->DropDownRows = 30;
ThisItem->DropDownListStyle = csDropDownList;
ThisItem->Items->Clear();
EditProperties = ThisItem;
ThisItem->Items->LoadFromFile("c:\\123.txt");
}
//---------------------------------------------------------------------------

上面的代码虽然可以实现赋值,但在下面的函数中,却截获不到响应:

void __fastcall TGridForm::cxTreeListColumn1PropertiesChange(TObject *Sender)
{
ShowMessage(“AAAAAAAA”);
}
//---------------------------------------------------------------------------


现在的问题是:

1、怎样动态赋值才能让 cxTreeListColumn1PropertiesChange 中截获消息?

2、如果想实现两个列 cxTreeListColumn1 和 cxTreeListColumn2 的 ComboBox 联动,应该怎样实现?

 联动效果举例:比如当选择了cxTreeListColumn1中的一个 ComboBox 的 Item 后,cxTreeListColumn2 中的 ComboBox 自动选择另一值,

  如:cxTreeListColumn2->ComboBox->ItemIndex = cxTreeListColumn1->ComboBox->ItemIndex;

  当然上面这句代码是不对的,只是说明想达到的一种效果。
...全文
275 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
ccrun.com 2011-09-28
  • 打赏
  • 举报
回复
第一个问题,赋值以后再调用一下cxTreeListColumn1PropertiesChange 函数即可。
第二个问题,理论上讲,那个代码应该有效啊。只是我很久不用第三方控件,没法帮你测试。

604

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder VCL组件使用和开发
社区管理员
  • VCL组件使用和开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧