I have the below markup for a DxAccordion, which is working.
It seems that the CssClass has no effect, no matter what class is used.
The ItemContentTemplate is fine, but I would like to change the appearance of the main Item.
How can I apply a css class to the main item?
Razor<DxAccordion @ref="accD" Data="@FaqList"
CssClass="text-primary"
ExpandCollapseAction="AccordionExpandCollapseAction.Auto"
ExpandMode="AccordionExpandMode.MultipleOrNone"
AnimationType="LayoutAnimationType.Slide">
<DataMappings>
<DxAccordionDataMapping AllowSelection="true" Text="FaqQuestion"
Key="FaqID"></DxAccordionDataMapping>
</DataMappings>
<ItemContentTemplate>
<div class="p-2 ps-45 fs-6">
@(((FAQCls)context.DataItem).FaqAnswer)
</div>
</ItemContentTemplate>
</DxAccordion>
Hello,
If you wish to modify the appearance of an item header, you can use the ItemTemplate option. Is this what you're looking for?
Regards,
John
Thanks. The ItemTemplate did not work, but the ItemHeaderTextTemplate did work.
If the only way to apply a class to the DxAccordion is via templates, what is the purpose of the CssClass?
I also think that there should be examples of using templates with databinding.