treeview自动添加节点 一个学生管理系统,希望按照入学时间来分,怎样在添加记录的时候判断入学时间是否在已经存在的节点上,如果没有就自动添加一个节点 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 TreeNode 对象... 往接点的Nodes集合中加. /// <summary> /// 自动创建树形节点 /// </summary> private void CreatTree() { DataSet ds = new DataSet(); BLL.DeviceGroup bll = new BLL.DeviceGroup(); ds = bll.GetGroup();//从设备组里得到全省城市名 int count = ds.Tables[0].Rows.Count; //根节点 for (int i = 0; i < count; i++) { if (ds.Tables[0].Rows[i][1].ToString() == "...") { TreeNode tn = new TreeNode(); tn.Value = "..."; tn.Text = "..."; tv.Nodes.Add(tn); TreeNode tn1 = new TreeNode("..."); tv.Nodes.Add(tn1); } else { continue; } } //一级子节点 for (int j = 0; j < count; j++) { if (ds.Tables[0].Rows[j][0].ToString().Length == 2 && (ds.Tables[0].Rows[j][1].ToString() != "...")) { TreeNode tn = new TreeNode(ds.Tables[0].Rows[j][1].ToString()); tv.Nodes[0].ChildNodes.Add(tn); } } 如何实现多画面的切换技术? 问个简单的问题 求确定 排列组合问题?????????? 两个textbox我想判断它输入的时间间隔不超过3个月应该怎么判断? 【回答快,结贴更快】正则一点不会,给会的人散分,超简单 各位大虾,导入csv文件时,如何判断是两个不同的csv文件? 想学.Net和C# 大家介绍些好的资源吧 !! dataset的table中修改的行,再次修改的问题 关于int型转换为string型的问题 测试FTP站点,通与否麻烦回帖说明一下! OLEDB 打开ACCESS数据库的问题 急,急,oracle时间显示问题??
往接点的Nodes集合中加.
/// <summary>
/// 自动创建树形节点
/// </summary>
private void CreatTree()
{
DataSet ds = new DataSet();
BLL.DeviceGroup bll = new BLL.DeviceGroup();
ds = bll.GetGroup();//从设备组里得到全省城市名
int count = ds.Tables[0].Rows.Count;
//根节点
for (int i = 0; i < count; i++)
{
if (ds.Tables[0].Rows[i][1].ToString() == "...")
{
TreeNode tn = new TreeNode();
tn.Value = "...";
tn.Text = "...";
tv.Nodes.Add(tn); TreeNode tn1 = new TreeNode("...");
tv.Nodes.Add(tn1);
}
else
{
continue;
}
}
//一级子节点
for (int j = 0; j < count; j++)
{
if (ds.Tables[0].Rows[j][0].ToString().Length == 2 && (ds.Tables[0].Rows[j][1].ToString() != "..."))
{
TreeNode tn = new TreeNode(ds.Tables[0].Rows[j][1].ToString());
tv.Nodes[0].ChildNodes.Add(tn);
}
}