private void MenuItemsControl_Load(object sender, EventArgs e) { menuList = new ChattersLib.ChattersDBLists.MenuList(); menuList.GetAll(); menuListFilter = new ChattersLib.ChattersDBLists.MenuList(); menuListFilter.Insert(0, new ChattersLib.ChattersDBBusiness.Menu() { ID = 0, Title = "All" }); menuList.ForEach(x => { menuListFilter.Add(x); }); menuList.Insert(0, new ChattersLib.ChattersDBBusiness.Menu() { ID = 0, Title = "None" }); menuListBindingSource.DataSource = menuList; menuListBindingSourceFilter.DataSource = menuListFilter; menuItemList = new ChattersLib.ChattersDBLists.MenuItemList(); menuItemList.GetAll(); ConvertToView(); menuItemListBindingSource.DataSource = menuItemList; refresh(); }
public MenuItemsControl() { InitializeComponent(); menuList = new ChattersLib.ChattersDBLists.MenuList(); menuList.GetAll(); menuListFilter = new ChattersLib.ChattersDBLists.MenuList(); menuListFilter.Insert(0, new ChattersLib.ChattersDBBusiness.Menu() { ID = 0, Title = "All" }); menuList.ForEach(x => { menuListFilter.Add(x); }); menuList.Insert(0, new ChattersLib.ChattersDBBusiness.Menu() { ID = 0, Title = "None" }); menuListBindingSource.DataSource = menuList; menuListBindingSourceFilter.DataSource = menuListFilter; menuItemList = new ChattersLib.ChattersDBLists.MenuItemList(); menuItemList.GetAll(); ConvertToView(); menuItemListBindingSource.DataSource = menuItemList; }
protected void Page_Load(object sender, EventArgs e) { ChattersLib.ChattersDBLists.MenuList menuList = new ChattersLib.ChattersDBLists.MenuList(); menuList.GetAll(); if (subMenues == null) subMenues = new List<subMenuControl>(); menuList.ForEach(x => { x.GetMenuItems(); subMenuControl subMenu = Page.LoadControl("~/Controls/subMenuControl.ascx") as subMenuControl; if (subMenu != null) { subMenu.ID = "subMenu" + x.ID; subMenu.Title = x.Title; subMenu.Description = x.Description; subMenu.MenuItems = x.MenuItems; subMenu.Collapsed = false; subMenues.Add(subMenu); placeHolderSubMenus.Controls.Add(subMenu); } }); if (Request.QueryString["Sub"] != null) { //int indexOf = placeHolderSubMenus.Controls.IndexOf(subMenues.Find(x => x.ID == "subMenu" + x.ID)); foreach (subMenuControl subMenu in placeHolderSubMenus.Controls) { subMenu.Collapsed = subMenu.ID != "subMenu" + Request.QueryString["Sub"]; } } }
public MenusControl() { InitializeComponent(); menuList = new ChattersLib.ChattersDBLists.MenuList(); menuList.GetAll(); menuListBindingSource.DataSource = menuList; }
internal void ResetMenus() { menuList = new ChattersLib.ChattersDBLists.MenuList(); menuList.GetAll(); menuList.Insert(0, new ChattersLib.ChattersDBBusiness.Menu() { ID = 0, Title = "None" }); menuListBindingSource.DataSource = menuList; }