Closed gingters closed 6 years ago
Hi, sorry I missed this. Are you still having this problem?
Think this might work:
public class SomeViewModel{
public FumeroleType FumeroleType { get; set; }
public IEnumerable<FumeroleType > FumeroleType _choices()
{
yield return new FumeroleType {Value = "FirstItem"}.DisplayName("FirstItem");
yield return new FumeroleType {Value = "SecondItem"}.DisplayName("SecondItem");
yield return new FumeroleType {Value = "ThirdItem"}.DisplayName("ThirdItem");
yield return new OtherFumeroleType {Value = "Other"}.DisplayName("Other");
};
public class FumeroleType
{
public string Value { get; set; }
}
public class OtherFumeroleType : FumeroleType
{
public string OtherValue {get;set;}
}
}
Hi,
I have a enum, and the user should select one of the entries in the enum with a radio box, and a textbox which should only be enabled when a certain element in the dropdown is selected.
Example:
Please select an item:
If other, what other item did you select?: [Textbox] (should be editable only if
Other
is selected above.)In short, I want to replicate the Fomerole Type from this reporting form but with a bit more validation logic: https://docs.google.com/forms/d/e/1FAIpQLSeYI4R29n-n6eMQTxoL_Nh5rF26NUGxQQqt5dOH7YCT2A1gzA/viewform
Besides that, I can't get it working. I specified this:
With
FumeroleType
being my enum, but it renders as a dropdown and not as a radio button list.