Пример #1
0
        public void BindData()
        {
            string prefix = "--";

            ddlForums.Items.Clear();
            //insert root item if required
            if (!String.IsNullOrEmpty(this.RootItemText))
            {
                var itemRoot = new ListItem(this.RootItemText, "0");
                this.ddlForums.Items.Add(itemRoot);
            }
            var forumGroups = ForumManager.GetAllForumGroups();

            foreach (var forumGroup in forumGroups)
            {
                var forumGroupItem = new ListItem(forumGroup.Name, "0");
                this.ddlForums.Items.Add(forumGroupItem);

                var forums = forumGroup.Forums;
                foreach (var forum in forums)
                {
                    var forumItem = new ListItem(prefix + forum.Name, forum.ForumId.ToString());
                    this.ddlForums.Items.Add(forumItem);
                    if (forum.ForumId == this.selectedForumId)
                    {
                        forumItem.Selected = true;
                    }
                }
            }

            this.ddlForums.DataBind();
        }
Пример #2
0
        private void BindData()
        {
            var forumGroups = ForumManager.GetAllForumGroups();

            rptrForumGroups.DataSource = forumGroups;
            rptrForumGroups.DataBind();
        }
Пример #3
0
        public void BindData()
        {
            string prefix = "--";

            ddlForums.Items.Clear();
            var forumGroups = ForumManager.GetAllForumGroups();

            foreach (var forumGroup in forumGroups)
            {
                var forumGroupItem = new ListItem(forumGroup.Name, "0");
                this.ddlForums.Items.Add(forumGroupItem);

                var forums = forumGroup.Forums;
                foreach (var forum in forums)
                {
                    var forumItem = new ListItem(prefix + forum.Name, forum.ForumId.ToString());
                    this.ddlForums.Items.Add(forumItem);
                    if (forum.ForumId == this.selectedForumId)
                    {
                        forumItem.Selected = true;
                    }
                }
            }

            this.ddlForums.DataBind();
        }
Пример #4
0
        void BindData()
        {
            ForumGroupCollection forumGroups = ForumManager.GetAllForumGroups();

            btnAddNewForum.Visible = forumGroups.Count > 0;

            rptrForumGroups.DataSource = forumGroups;
            rptrForumGroups.DataBind();
        }
Пример #5
0
        private void FillDropDowns()
        {
            this.ddlForumGroup.Items.Clear();
            ForumGroupCollection forumGroups = ForumManager.GetAllForumGroups();

            foreach (ForumGroup forumGroup in forumGroups)
            {
                ListItem item2 = new ListItem(forumGroup.Name, forumGroup.ForumGroupID.ToString());
                this.ddlForumGroup.Items.Add(item2);
            }
        }