Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select List Disabled Items #277

Open
meister-d opened this issue Mar 14, 2016 · 1 comment
Open

Select List Disabled Items #277

meister-d opened this issue Mar 14, 2016 · 1 comment

Comments

@meister-d
Copy link

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

@meister-d
Copy link
Author

An Example of what I think it should look and behave can be found here:

https://select2.github.io/examples.html#disabled-results

Regards Dumitru

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant