110,566
社区成员
发帖
与我相关
我的任务
分享
public void BindTXL()
{
this.tvTXL.Nodes.Clear();
TreeNode node = new TreeNode();
node.Text = "我的通讯录";
node.Name = "0";
node.ImageIndex = 0;
string sqla = "select id,txlName from TXL";
DataSet ds = dbOperation.Query(sqla, "TXL");
TreeNode childNode = null;
foreach (DataRow row in ds.Tables[0].Rows)
{
childNode = new TreeNode();
string id = row["id"].ToString();
string name = row["txlName"].ToString();
childNode.Text = name;
childNode.Name = id;
childNode.ImageIndex = 0;
node.Nodes.Add(childNode);
// MessageBox.Show("绑定" + name);
}
this.tvTXL.Nodes.Add(node);
this.tvTXL.ExpandAll();
}
private void btnNew_Click(object sender, EventArgs e)
{
frmXJQZ xjqz = new frmXJQZ();
//xjqz.Owner = this;
xjqz.ShowDialog();//弹出from2 添加节点。
BindTXL();//重新绑定节点。
}
private void btnNew_Click(object sender, EventArgs e)
{
frmXJQZ xjqz = new frmXJQZ();
//xjqz.Owner = this;
if(DialogResult.OK==xjqz.ShowDialog()) //弹出from2 添加节点。//把xjqz form关闭设置为OK
BindTXL();//重新绑定节点。
}