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

How to create list control programatically? #88

Open
sahinaydin opened this issue Nov 19, 2019 · 2 comments
Open

How to create list control programatically? #88

sahinaydin opened this issue Nov 19, 2019 · 2 comments

Comments

@sahinaydin
Copy link

Hello. I would like to create list control programatically. There exist an example about List Rendering on the web page but I could not create this control programatically. Could you help about this matter?

@mcintyre321
Copy link
Owner

var formModel = new[]
            {
                    new PropertyVm(typeof(IEnumerable<string>) , "RestrictedMaterials")
                    {
                        DisplayName = "RestrictedMaterials",
                        Choices = new[] { "Guns", "Knives", "Explosives", "Nuclear Waste", "Weaponised Viruses" },
                        Value = new[] {"Guns", "Explosives"} ,
                        Readonly = false ,
                                    
                    },
};

 
FF.PropertiesFor(formModel).Render().Dump();

I think it should be something like that.

@sahinaydin
Copy link
Author

Thank you very much. It's worked.

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

2 participants