New to Telerik UI for ASP.NET MVC? Download free 30-day trial

How can I display audio files within the Grid

Environment

Product 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

  1. Utilize a Column Template
  2. Within the template, add the conventional audio element that is primarily utilized for displaying an audio file on a the web page.
  3. 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.

In this article