Devexpress 13.2 - 在树形列中添加浏览按钮

时间:2014-01-13 14:48:16

标签: c# winforms devexpress devexpress-windows-ui

我在数据库中有一个表,列为:

CategoryId
CategoryName
ParentCategoryId
CategoryPath

CategoryPath仅在其为子元素时才具有值。现在填写treeviewlist我写了以下代码:

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列,我想添加一个图像,该图像将打开文件对话框,其中用户可以选择文件名,并且完整路径将保存在数据库中。

你能否建议做什么,以便有路径时它应该出现在列中以及图像按钮以改变路径;当用户想要为尚未指定路径的子元素分配新路径时,也应显示图像。

非常感谢任何帮助。

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

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

相关问题