I am building questionnaire component and able to show Question text in ListView using Template. However when I try to display Options for that particular questions, it doesn't work.
div id="questionnaireTarget">
<SfDialog Width="1080px" Height="700px" Target="#questionnaireTarget" ShowCloseIcon="true" @bind-Visible="@DialogVisible">
<DialogTemplates>
<Header>Questionnaire</Header>
<Content>
<SfListView DataSource="@Questionnaire">
<ListViewFieldSettings Id="QuestionnaireId" Text="QuestionText" TValue="QuestionnaireX" />
<ListViewTemplates TValue="QuestionnaireX">
<Template>
<span style="display: block; word-wrap:break-word; white-space: normal">
@context.QuestionText
</span>
@{
foreach (var option in context.Options)
{
<div>
@option.OptionText
</div>
}
}
</Template>
</ListViewTemplates>
</SfListView>
</Content>
</DialogTemplates>
<DialogButtons>
<DialogButton Content="Save" IsPrimary="true" OnClick="OnQuestionnaireSaveClick"></DialogButton>
<DialogButton Content="Cancel" IsPrimary="true" OnClick="OnQuestionnaireCancelClick"></DialogButton>
</DialogButtons>
</SfDialog>
</div>
public class QuestionnaireX : BaseModel
{
public long QuestionnaireId { get; set; }
public long QuestionId { get; set; }
public string QuestionText { get; set; }
public List<QuestionOptionModel> Options { get; set; }
}