We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Accordion for version 17.3.29.

Thread ID:

Created:

Updated:

Platform:

Replies:

151302 Feb 6,2020 09:03 AM UTC Feb 7,2020 12:46 PM UTC Blazor 1
loading
Tags: Accordion
j
Asked On February 6, 2020 09:03 AM UTC

I'm starting to believe that these sample codes are written for v17.4.x.x, am I correct. Do you still have sample code for 17.3.29, it's actually the one I'm using for now and I don't have a reference for that version. Thank you.

@using Syncfusion.EJ2.Blazor.Navigations

<EjsAccordion DataSource="@AccordionItems" ModelType="@typeof(AccordionData)">
    <AccordionTemplates>
        <HeaderTemplate>
            <div>@((context as AccordionData).EmployeeName)</div>
        </HeaderTemplate>
        <ItemTemplate>
            @{
                AccordionData ContextData = context as AccordionData;
                <div>
                    <div><b>Employee ID: </b>@ContextData.EmployeeId</div>
                    <div><b>Designation: </b>@ContextData.Designation</div>
                </div>
            }
        </ItemTemplate>
    </AccordionTemplates>
</EjsAccordion>

@code{
    List<AccordionData> AccordionItems = new List<AccordionData>()
{
            new AccordionData
            {
            EmployeeId = 1,
            EmployeeName = "Laura Callahan",
            Designation = "Product Manager",
            },
            new AccordionData
            {
            EmployeeId = 3,
            EmployeeName = "Andrew Fuller",
            Designation = "Team Lead",
            },
            new AccordionData
            {
            EmployeeId = 4,
            EmployeeName = "Anne Dodsworth",
            Designation = "Developer"
            },
            new AccordionData
            {
            EmployeeId = 5,
            EmployeeName = "Nancy Davolio",
            Designation = "Product Manager"
            }
    };

    public class AccordionData
    {
        public string EmployeeName { get; set; }
        public int EmployeeId { get; set; }
        public string Designation { get; set; }
    }
}

d

Alagumeena Kalaiselvan [Syncfusion]
Replied On February 7, 2020 12:46 PM UTC

Dear Customer, 

Thanks for contacting Syncfusion support! 

Yes, the current user guide document reflects the 17.4 release version. You can use the Accordion ModelType as Object instead of System.Type for the specified version “V17.3.29”. Refer below code for that 

@using Syncfusion.EJ2.Blazor.Navigations 
 
<EjsAccordion DataSource="@AccordionItems" ModelType="AccordionModel"> 
    <AccordionTemplates> 
        <HeaderTemplate> 
            <div>@((context as AccordionData).EmployeeName)</div> 
        </HeaderTemplate> 
        <ItemTemplate> 
            @{ 
                AccordionData ContextData = context as AccordionData; 
                <div> 
                    <div><b>Employee ID: </b>@ContextData.EmployeeId</div> 
                    <div><b>Designation: </b>@ContextData.Designation</div> 
                </div> 
            } 
        </ItemTemplate> 
    </AccordionTemplates> 
</EjsAccordion> 
 
@code{ 
    AccordionData AccordionModel = new AccordionData(); 
    List<AccordionData> AccordionItems = new List<AccordionData>() 
{ 
            new AccordionData 
            { 
            EmployeeId = 1, 
            EmployeeName = "Laura Callahan", 
            Designation = "Product Manager", 
            }, 
            new AccordionData 
            { 
            EmployeeId = 3, 
            EmployeeName = "Andrew Fuller", 
            Designation = "Team Lead", 
            }, 
            new AccordionData 
            { 
            EmployeeId = 4, 
            EmployeeName = "Anne Dodsworth", 
            Designation = "Developer" 
            }, 
            new AccordionData 
            { 
            EmployeeId = 5, 
            EmployeeName = "Nancy Davolio", 
            Designation = "Product Manager" 
            } 
    }; 
 
    public class AccordionData 
    { 
        public string EmployeeName { get; set; } 
        public int EmployeeId { get; set; } 
        public string Designation { get; set; } 
    } 
} 

Also you can download this sample by the following link 

Kindly get back to us, if you need further assistance 

Regards 
Alagumeena.K 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon