private void LoadUltraMenu() { NhomSanPham nsp = new NhomSanPham(); //get Nhomsanpham DataSet ds; if (Cache["Menu"] == null) { ds = nsp.SelectAllNhomSanPhamByLevel(); Cache["menu"] = ds; } else { ds = (DataSet) Cache["menu"]; } ds.Relations.Add("menu", ds.Tables[0].Columns["NhomSanPhamID"], ds.Tables[1].Columns["NhomChaID"], false); ds.Relations.Add("menucon", ds.Tables[1].Columns["NhomSanPhamID"], ds.Tables[2].Columns["NhomChaID"], false); //ds.WriteXml(Server.MapPath("." + "\\menu.xml"), XmlWriteMode.WriteSchema); //ds.WriteXml(Server.MapPath(".") + "\\menu.xml"); // //DataView dv = ds1.Tables[0].DefaultView; uwmMenu.DataSource = ds; uwmMenu.Levels[0].ColumnName = "TenNhomSanPham"; // this.uwmMenu.Levels[i].LevelImage = "../../../ig_common/images/dir.png"; uwmMenu.Levels[0].RelationName = "menu"; uwmMenu.Levels[0].LevelKeyField = "NhomSanPhamID"; uwmMenu.Levels[0].TargetUrlName = "TargetUrl"; uwmMenu.Levels[1].ColumnName = "TenNhomSanPham"; // this.uwmMenu.Levels[i].LevelImage = "../../../ig_common/images/dir.png"; uwmMenu.Levels[1].RelationName = "menucon"; uwmMenu.Levels[1].LevelKeyField = "NhomSanPhamID"; uwmMenu.Levels[1].TargetUrlName = "TargetUrl"; uwmMenu.Levels[2].ColumnName = "TenNhomSanPham"; // this.uwmMenu.Levels[i].LevelImage = "../../../ig_common/images/dir.png"; //uwmMenu.Levels[1].RelationName = "con"; uwmMenu.Levels[2].TargetUrlName = "TargetUrl"; uwmMenu.Levels[2].LevelKeyField = "NhomSanPhamID"; uwmMenu.DataMember = ds.Tables[0].TableName; uwmMenu.DataBind(); }