Displaying Audio Files within the Grid
Environment
Product | Telerik UI for ASP.NET MVC Grid |
Progress Telerik UI for ASP.NET MVC version | Created with the 2022.2.621 version |
Description
How can I display audio files within the Telerik UI for ASP.NET MVC Grid?
Solution
- Utilize a Column Template
- Within the template, add the conventional audio element that is primarily utilized for displaying an audio file on a the web page.
- Specify the file name and extension using the Template Syntax.
public class EmployeeViewModel
{
public string Sound { get; set; } //stores both the file name and extension
}
.Columns(columns =>
{
columns.Bound(p => p.Sound).Width(350).ClientTemplate("<audio controls><source src='./#=Sound#'/></audio>");
})
For a complete implementation of the suggested approach, refer to the following GitHub Project.