private void ViewAllRoom_Load(object sender, EventArgs e)
{
//This Is Parent Node
TreeNode MainNode = new TreeNode();
MainNode.NodeFont = new Font("Microsoft Sans Serif", 10);
MainNode.Name = "MainName";
MainNode.Text = "All Rooms";
MainNode.ForeColor = Color.Red;
this.treeView1.Nodes.Add(MainNode);
//Next add child Node
ds = da.GetDataTable("SELECT RName FROM RTypeCreation");
foreach (DataRow Parentrow in ds.Tables[0].Rows)
{
TreeNode treenode = new TreeNode((string)Parentrow["RName"]);
MainNode.Nodes.Add(treenode);
treenode.NodeFont = new Font("Microsoft Sans Serif", 10);
treenode.ForeColor = Color.Tan;
}
No comments:
Post a Comment