1个回答
展开全部
这个是商品类型分级的代码,给你参考一下,主要是递归调用节点的加载
private void RefreshTreeView() //根节点,所有节点挂在这个节点下
{
TreeNode tmp = new TreeNode("商品分类");//根节点
tmp.Tag = "";
this.GoodsTypetreeView.Nodes.Add(tmp);
//获取数据,显示到GoodsTypetreeView
String sqlStr = String.Format(@"Select TypeCode,TypeName,ParentTypeCode,case IsCommon when '0' then '否' else '是'
end as IsCommon,case Status when '0' then '未用' else '使用' end as Status,Remark from Com_GoodsType where Status = 1");
DataSet ds = SqlDBHelper.GetDs(sqlStr);
//nodes(this.GoodsTypetreeView.Nodes, ds, 0);
nodes(tmp, ds, "");
}
private void RefreshTreeView() //根节点,所有节点挂在这个节点下
{
TreeNode tmp = new TreeNode("商品分类");//根节点
tmp.Tag = "";
this.GoodsTypetreeView.Nodes.Add(tmp);
//获取数据,显示到GoodsTypetreeView
String sqlStr = String.Format(@"Select TypeCode,TypeName,ParentTypeCode,case IsCommon when '0' then '否' else '是'
end as IsCommon,case Status when '0' then '未用' else '使用' end as Status,Remark from Com_GoodsType where Status = 1");
DataSet ds = SqlDBHelper.GetDs(sqlStr);
//nodes(this.GoodsTypetreeView.Nodes, ds, 0);
nodes(tmp, ds, "");
}
追问
GoodsTypetreeView这个是哪个属性方法?还是控件
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询