Skip to content

Select List Disabled Items #277

@meister-d

Description

@meister-d

Hi BForms Team
is it possible to disable ("grey out") an Item form a BsControlType.DropDownList. If I set the Disabled Property on the BsSelectListItem nothing happens when the Control is rendered:

private BsSelectList<string> GetRolesDropDown(Admin admin)
        {
            BsSelectList<string> rolesddl = new BsSelectList<string>();

            foreach(AdminRole r in AUDMServiceContext.Instance.Roles)
            {
                BsSelectListItem tmpItem = new BsSelectListItem
                {
                    Text = r.Name,
                    Value = r.Id
                };

                if (admin.Roles.FirstOrDefault(role => role.Id == r.Id) != null)
                   tmpItem.Disabled = true; 

                 rolesddl.Items.Add(tmpItem);
            }

            return rolesddl;
        }

Regards Dumitru

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions