【发布时间】:2014-01-13 14:48:16
【问题描述】:
我在数据库中有一个表,列如下:
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 列,我想添加一个图像,该图像将打开文件对话框,用户可以从中选择文件名,完整路径将保存在数据库中。
您能否建议如何操作,以便在有路径的位置出现在列中,并与图像按钮一起更改路径;当用户想要为尚未指定路径的子元素分配新路径时,该图像也应该出现。
任何帮助将不胜感激。
【问题讨论】:
-
只是好奇,为什么不试试 devexpress 支持。他们非常乐于助人且反应迅速。
-
:) 从他们的网站找到解决方案。
标签: c# winforms devexpress devexpress-windows-ui