日期:2014-05-17 浏览次数:20405 次
foreach (DataRowView drv in dv)
{
if (tn == null)
{
//提示我没有将对象引用实例化
tn.Text = drv["c_Name"].ToString();
tn.Value = drv["fatherCol"].ToString();
this.tvList.Nodes.Add(tn);
BindTreeNode(Int32.Parse(drv["fatherCol"].ToString()), tn1);
}
else
{
tn1 = new TreeNode();
tn1.Text = drv["c_Name"].ToString();
tn1.Value = drv["fatherCol"].ToString();
tn.ChildNodes.Add(tn1);
BindTreeNode(Int32.Parse(drv["fatherCol"].ToString()),tn);
}
}