Ticket T1282462
Visible to All Users

Blazor DxAccordion CssClass

created 3 days ago

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>
Comments (2)
John (DevExpress Support) 13 hours ago

    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.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.