Hi Erik,
Greetings from Syncfusion support.
Instead of CSS styling, you can make use of templates to display the image/icon in the list item. In the template, we need to have img tag and use the image path in the src attribute. Here is some code snippet for your reference,
@using Syncfusion.EJ2
@section ControlsSection{
@{ var template = "<div ${if(category!==null)} class = 'clearfix desc e-list-wrapper e-list-multi-line e-list-avatar' ${else} "
+ "class = 'clearfix e-list-wrapper e-list-multi-line e-list-avatar' ${/if}> ${if(imgSrc!=='')} <img class='e-avatar' src=${imgSrc} />"
+ "${/if} <span class='e-list-item-header'>${title} </span>"
+ "<span class='e-list-content e-text-overflow' >${description} </span> ${if(timeStamp!=='')} <div id='list-logo'>"
+ "<span class='bookmark'></span> <span class='comments'></span>"
+ "<span class='share'></span></div> <div class='timeStamp'>"
+ "${timeStamp} </div> ${/if} </div>";}
<div class="control-section">
<ejs-listview enable="true" id="listview_template" dataSource="ViewBag.dataSource" cssClass="e-list-template"
headerTitle="Syncfusion Blog" template=@template showHeader="true" actionComplete="onComplete">
</ejs-listview>
</div>
} |
Please check with below online sample for reference,
Please get back to us if you require any further assistance.
Thanks,
Christo