当前位置: 首页>>代码示例>>C#>>正文


C# RadComboBoxItem.FindControl方法代码示例

本文整理汇总了C#中RadComboBoxItem.FindControl方法的典型用法代码示例。如果您正苦于以下问题:C# RadComboBoxItem.FindControl方法的具体用法?C# RadComboBoxItem.FindControl怎么用?C# RadComboBoxItem.FindControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RadComboBoxItem的用法示例。


在下文中一共展示了RadComboBoxItem.FindControl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadSchoolDropdown

        private void LoadSchoolDropdown()
        {
            schoolDropdown.Items.Clear();
            
            //Build school ListBox
            foreach (var school in _schools)
            {
                var schoolListItem = new RadComboBoxItem
                    {
                        Text = school.Name,
                        Value = school.ID.ToString(CultureInfo.InvariantCulture)
                    };

                schoolDropdown.Items.Add(schoolListItem);

                var itemLabel = (Label)schoolListItem.FindControl("schoolLabel");

                if (itemLabel != null)
                {
                    itemLabel.Text = school.Name;
                }
            }

            var findButton = new RadComboBoxItem();
            schoolDropdown.Items.Add(findButton);

            var findButtonCheckbox = (CheckBox)findButton.FindControl("schoolCheckbox");
            if (findButtonCheckbox != null)
            {
                findButtonCheckbox.InputAttributes["style"] = "display:none;";
            }
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:32,代码来源:AddStaff.aspx.cs

示例2: BuildStandards

        private void BuildStandards()
        {
            var selectedStandards = (List<int>)ViewState[StandardsFilterKey];
            if (_standardsDT == null) _standardsDT = Base.Classes.Standards.GetStandardsForInstructionalPlan(1, _classID, _term);
            if (_standardsDT == null || _standardsDT.Rows.Count == 0) return;

            resourceStandardsDropdown.Items.Clear();
            var resourceStandardsDropdownCheckedItemsTotal = 0;

            var resourceStandardsListItemAll = new RadComboBoxItem();
            resourceStandardsListItemAll.Text = "All Standards";
            resourceStandardsListItemAll.Value = "All Standards";
            resourceStandardsDropdown.Items.Add(resourceStandardsListItemAll);

            var allItemCheckbox = (CheckBox)resourceStandardsListItemAll.FindControl("resourceStandardsCheckBox");
            var allItemLabel = (Label)resourceStandardsListItemAll.FindControl("resourceStandardsLabel");
            allItemCheckbox.Attributes["onclick"] = "RadCombobox_CustomMultiSelectDropdown_evaluateCheckedItem(this, '" + resourceStandardsDropdown.ClientID + "', 'resourceStandards')";
            if (selectedStandards.Count == _standardsDT.Rows.Count || selectedStandards.Count == 0)
            {
                if (allItemCheckbox != null)
                {
                    allItemCheckbox.Checked = true;
                    resourceStandardsDropdown.Text = "All Standards";
                }
            }
            if (allItemLabel != null)
            {
                allItemLabel.Text = "All Standards";
            }

            foreach (DataRow row in _standardsDT.Rows)
            {
                var resourceStandardsListItem = new RadComboBoxItem();
                resourceStandardsListItem.Text = row["StandardName"].ToString();
                resourceStandardsListItem.Value = row["StandardID"].ToString();

                resourceStandardsDropdown.Items.Add(resourceStandardsListItem);

                var itemCheckbox = (CheckBox)resourceStandardsListItem.FindControl("resourceStandardsCheckbox");
                var itemLabel = (Label)resourceStandardsListItem.FindControl("resourceStandardsLabel");
                itemCheckbox.Attributes["onclick"] = "RadCombobox_CustomMultiSelectDropdown_evaluateCheckedItem(this, '" + resourceStandardsDropdown.ClientID + "', 'resourceStandards')";
                bool itemExistsInSession = selectedStandards.Contains(DataIntegrity.ConvertToInt(row["StandardID"]));

                if (itemCheckbox != null)
                {
                    if (selectedStandards.Count == _standardsDT.Rows.Count || selectedStandards.Count == 0)
                    {
                        itemCheckbox.Checked = true;
                        resourceStandardsDropdownCheckedItemsTotal++;
                    }
                    else if (itemExistsInSession)
                    {
                        itemCheckbox.Checked = true;
                        resourceStandardsDropdownCheckedItemsTotal++;
                        resourceStandardsDropdown.Text = row["StandardName"].ToString();
                    }
                }
                if (itemLabel != null)
                {
                    itemLabel.Text = row["StandardName"].ToString();
                }
            }

            if (resourceStandardsDropdownCheckedItemsTotal == _standardsDT.Rows.Count)
            {
                resourceStandardsDropdown.Items[0].Checked = true;
                var itemCheckbox = (CheckBox)resourceStandardsDropdown.Items[0].FindControl("resourceStandardsCheckbox");
                itemCheckbox.Checked = true;
                resourceStandardsDropdown.Items[0].Selected = true;
            }
            else if (resourceStandardsDropdownCheckedItemsTotal > 1)
            {
                resourceStandardsDropdown.Text = "Multiple";
            }

            var findButton = new RadComboBoxItem();
            resourceStandardsDropdown.Items.Add(findButton);

            var findButtonCheckbox = (CheckBox)findButton.FindControl("resourceStandardsCheckbox");
            var findButtonImg = (HtmlImage)findButton.FindControl("okImgBtn");
            findButtonImg.Src = ResolveUrl("~/Images/ok.png");
            findButtonCheckbox.Attributes["onclick"] = "RadCombobox_CustomMultiSelectDropdown_evaluateCheckedItem(this, '" + resourceStandardsDropdown.ClientID + "', 'resourceStandards')";
            if (findButtonCheckbox != null)
            {
                findButtonCheckbox.InputAttributes["style"] = "display:none;";
            }
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:87,代码来源:LessonPlans.ascx.cs

示例3: LoadUserTypeDropdown

        private void LoadUserTypeDropdown()
        {
            userTypeDropdown.Items.Clear();
            int maxHierarchyLevel = SessionObject.LoggedInUser.Roles.OrderByDescending(y => y.RoleHierarchyLevel).First().RoleHierarchyLevel;
            
            //Build role ListBox
            foreach (var role in _roles)
            {
                //PLH - 11/12/2012 - Temporary fix to not allow admins to add teachers or teach plus. Also eliminates district superintendent. Currently this causes duplicates to appear after roster loads and causes
                //more issues than it solves
                if (role.RoleName.ToLower() != "teacher" && role.RoleName.ToLower() != "teach plus" && role.RoleName.ToLower() != "district superintendent" && role.RoleName.ToLower() != "student" && role.RoleHierarchyLevel >= maxHierarchyLevel)
                {
                    var userTypeListItem = new RadComboBoxItem {Text = role.RoleName, Value = role.RoleId.ToString()};

                    userTypeDropdown.Items.Add(userTypeListItem);

                    var itemLabel = (Label)userTypeListItem.FindControl("userTypeLabel");

                    if (itemLabel != null)
                    {
                        itemLabel.Text = role.RoleName;
                    }
                }
            }

            var findButton = new RadComboBoxItem();
            userTypeDropdown.Items.Add(findButton);

            var findButtonCheckbox = (CheckBox)findButton.FindControl("userTypeCheckbox");
            if (findButtonCheckbox != null)
            {
                findButtonCheckbox.InputAttributes["style"] = "display:none;";
            }
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:34,代码来源:AddStaff.aspx.cs

示例4: LoadUserTypeDropdown

        private void LoadUserTypeDropdown()
        {
            userTypeDropdown.Items.Clear();
            int userTypeDropdownCheckedItemsTotal = 0;

            RadComboBoxItem userTypeListItemAll = new RadComboBoxItem();
            //userTypeListItemAll.Text = "All";
            //userTypeListItemAll.Value = "Multiple";
            //userTypeDropdown.Items.Add(userTypeListItemAll);

            CheckBox allItemCheckbox = (CheckBox)userTypeListItemAll.FindControl("userTypeCheckBox");
            Label allItemLabel = (Label)userTypeListItemAll.FindControl("userTypeLabel");
            if (_selectedStaff.RoleList.Count > 1)
            {
                if (allItemCheckbox != null)
                {
                    allItemCheckbox.Checked = true;
                    userTypeDropdown.Text = "Multiple";
                }
            }
            if (allItemLabel != null)
            {
                allItemLabel.Text = "All";
            }

            int maxHierarchyLevel = SessionObject.LoggedInUser.Roles.OrderByDescending(y => y.RoleHierarchyLevel).First().RoleHierarchyLevel;

            //Build role ListBox
            foreach (var role in _roles)
            {
                //PLH - 11/12/2012 - Eliminates district superintendent from role dropdown. Temporary bandaid.
                if (role.RoleName.ToLower() != "district superintendent" && role.RoleName.ToLower() != "student")
                {
                    RadComboBoxItem userTypeListItem = new RadComboBoxItem();
                    Label userTypeLabel = (Label)userTypeListItem.FindControl("userTypeLabel");
                    
                    // 7715 - test coordinator is not allowed to change permission to district administrator
                    // rollbacked as requested
                    //SessionObject sessionObject = (SessionObject)Session["SessionObject"];
                    //if (sessionObject.LoggedInUser.Roles[0].RoleName.ToLower() == "test coordinator" && role.RoleName.ToLower() == "district administrator")
                    //{
                    //    continue;
                    //}

                    userTypeListItem.Text = role.RoleName;
                    userTypeListItem.Value = role.RoleId.ToString();

                    userTypeDropdown.Items.Add(userTypeListItem);

                    CheckBox itemCheckbox = (CheckBox)userTypeListItem.FindControl("userTypeCheckbox");
                    itemCheckbox.Enabled = role.RoleHierarchyLevel >= maxHierarchyLevel;
                    Label itemLabel = (Label)userTypeListItem.FindControl("userTypeLabel");
                    itemLabel.ForeColor = role.RoleHierarchyLevel >= maxHierarchyLevel ? System.Drawing.Color.Black : System.Drawing.Color.Gray;

                    if (itemCheckbox != null)
                    {
                        var isStaffRole = _selectedStaff.RoleList.Find(r => r.RoleId == role.RoleId);
                        if (isStaffRole != null)
                        {
                            itemCheckbox.Checked = true;
                            userTypeDropdownCheckedItemsTotal++;
                            userTypeListItem.Selected = true;
                            userTypeDropdown.Text = role.RoleName;
                        }
                    }
                    if (itemLabel != null)
                    {
                        itemLabel.Text = role.RoleName;
                    }
                    
                }
            }

            if (userTypeDropdownCheckedItemsTotal == _roles.Count)
            {
                userTypeDropdown.Items[0].Checked = true;
                userTypeDropdown.Items[0].Selected = true;
            }

            if (userTypeDropdownCheckedItemsTotal > 1)
            {
                userTypeDropdown.ClearSelection();
                userTypeDropdown.Text = "Multiple";
            }

            RadComboBoxItem findButton = new RadComboBoxItem();
            userTypeDropdown.Items.Add(findButton);

            CheckBox findButtonCheckbox = (CheckBox)findButton.FindControl("userTypeCheckbox");
            if (findButtonCheckbox != null)
            {
                findButtonCheckbox.InputAttributes["style"] = "display:none;";
            }
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:94,代码来源:StaffIdentification_Edit.aspx.cs

示例5: LoadSchoolDropdown

        private void LoadSchoolDropdown()
        {
            schoolDropdown.Items.Clear();
            int schoolDropdownCheckedItemsTotal = 0;

            RadComboBoxItem schoolListItemAll = new RadComboBoxItem();
            //schoolListItemAll.Text = "All";
            //schoolListItemAll.Value = "Multiple";
            //schoolDropdown.Items.Add(schoolListItemAll);

            CheckBox allItemCheckbox = (CheckBox)schoolListItemAll.FindControl("schoolCheckBox");
            //Label allItemLabel = (Label)schoolListItemAll.FindControl("schoolLabel");
            if (_selectedStaff.SchoolList.Count > 1)
            {
                if (allItemCheckbox != null)
                {
                    allItemCheckbox.Checked = true;
                    schoolDropdown.Text = "Multiple";
                }
            }
            //if (allItemLabel != null)
            //{
            //    allItemLabel.Text = "All";
            //}

            //Build school ListBox
            foreach (var school in _schools)
            {
                RadComboBoxItem schoolListItem = new RadComboBoxItem();
                Label schoolLabel = (Label)schoolListItem.FindControl("schoolLabel");
                schoolListItem.Text = school.Name;
                schoolListItem.Value = school.ID.ToString();

                schoolDropdown.Items.Add(schoolListItem);

                CheckBox itemCheckbox = (CheckBox)schoolListItem.FindControl("schoolCheckbox");
                Label itemLabel = (Label)schoolListItem.FindControl("schoolLabel");

                if (itemCheckbox != null)
                {
                    var isStaffSchool = _selectedStaff.SchoolList.Find(s => s.ID == school.ID);
                    if (isStaffSchool != null)
                    {
                        itemCheckbox.Checked = true;
                        schoolListItem.Selected = true;
                        schoolDropdownCheckedItemsTotal++;
                        schoolDropdown.Text = school.Name;
                    }
                }
                if (itemLabel != null)
                {
                    itemLabel.Text = school.Name;
                }
            }

            if (schoolDropdownCheckedItemsTotal == _schools.Count)
            {
                schoolDropdown.Items[0].Checked = true;
                schoolDropdown.Items[0].Selected = true;
            }
            
            if (schoolDropdownCheckedItemsTotal > 1)
            {
                schoolDropdown.ClearSelection();
                schoolDropdown.Text = "Multiple";
            }

            RadComboBoxItem findButton = new RadComboBoxItem();
            schoolDropdown.Items.Add(findButton);

            CheckBox findButtonCheckbox = (CheckBox)findButton.FindControl("schoolCheckbox");
            if (findButtonCheckbox != null)
            {
                findButtonCheckbox.InputAttributes["style"] = "display:none;";
            }
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:76,代码来源:StaffIdentification_Edit.aspx.cs


注:本文中的RadComboBoxItem.FindControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。