예제 #1
0
        /// <summary>
        /// Fills DropDownList with root CategoryNodes.
        /// </summary>
        private void PopulateRootNodeDropDown()
        {
            RootNodeDropDown.Items.Clear();
            using (ResourceDataAccess dataAccess = new ResourceDataAccess(this.CreateContext()))
            {
                IList <CategoryNode> rootNodeList = dataAccess.GetRootCategoryNodes();

                if (rootNodeList != null && rootNodeList.Count > 0)
                {
                    foreach (CategoryNode node in rootNodeList)
                    {
                        node.Title = CoreHelper.FitString(CoreHelper.UpdateEmptyTitle(node.Title), _maxCharShownTree);
                    }
                }

                RootNodeDropDown.DataSource = rootNodeList;
                RootNodeDropDown.DataBind();
            }
        }