0

我在数据库中有一个表,其列如下:

CategoryId
CategoryName
ParentCategoryId
CategoryPath

只有当CategoryPath它是子元素时才会有值。现在要填充树视图列表,我编写了以下代码:

DataTable dt = d.CategoryGet(new System.Collections.Hashtable());
treeList1.DataSource = dt;
treeList1.KeyFieldName = info.CategoryParameters.CategoryId.ToString();
treeList1.ParentFieldName = info.CategoryParameters.ParentCategoryId.ToString();

treeList1.PopulateColumns();
treeList1.BestFitColumns();
treeList1.ExpandAll();

treeList1.FocusedNode = treeList1.Nodes[0];

对于该CategoryPath列,我想添加一个图像,该图像将打开文件对话框,用户可以从中选择文件名,完整路径将保存在数据库中。

您能否建议该怎么做,以便在有路径的位置出现在列中,并与图像按钮一起更改路径;当用户想要为尚未指定路径的子元素分配新路径时,该图像也应该出现。

任何帮助将非常感激。

4

2 回答 2

0

从 devexpress 站点找到解决方案。网址是: https ://www.devexpress.com/Support/Center/Question/Details/Q562627

于 2014-01-16T10:07:29.057 回答
0

为此使用 ButtonEdit 怎么样?

这是一个示例 http://documentation.devexpress.com/#WindowsForms/clsDevExpressXtraEditorsButtonEdittopic

于 2014-01-13T19:41:21.723 回答