Correct binding for dynamically created InputCheckboxes #56695
Unanswered
andyw-cyberkiln
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I am struggling to find the correct syntax to define the binds for InputCheckboxes for dynamically created options.
Here is a simplified version of what I'm trying to achieve:
First, I have an enum of available options:
Then I have a component which is rendered using Static Server Side Rendering.
On my component model, I have this property:
And finally I have the following code to generate the input check boxes inside an
<EditForm>
:What I require is the following:
Model.SelectedOptions.Contains(motiviationOption)
SelectedOptions
listCan I do this using some combination of
@bind-
properties on the InputCheckbox? Or do I need to revert to a standard<input type=checkbox/>
and what bindings would I need for the above functionality to work?Thanks all,
Andy
Beta Was this translation helpful? Give feedback.
All reactions