@page "/"
@* try changing FilterByColumnName to "Name;Company" *@
<MatTable Items="@contacts" Striped="true" class="mat-elevation-z5" FilterByColumnName="Name;Company" ShowPaging="false" >
<MatTableHeader>
<th style="min-width:5rem;">Id</th> <th style="min-width:10rem;">Name</th>
<th style="min-width:20rem;">Company</th> <th style="min-width:10rem;">Phone</th>
</MatTableHeader>
<MatTableRow>
<td>@context.Id</td> <td>@context.Name</td>
<td>@context.Company</td> <td>@context.Phone</td>
</MatTableRow>
</MatTable>
@code
{
public class Contact
{
public int Id { get; set; }
public string Name { get; set; }
public string Company { get; set; }
public string Phone { get; set; }
}
Contact[] contacts = new Contact[]
{
new Contact { Id=1, Name = "Amy", Company = "ABC Consulants", Phone = "0123456789" },
new Contact { Id=2, Name = "Bill", Company = "Bill & Associates", Phone = "0246813579" },
new Contact { Id=3, Name = "Carol", Company = "Coral Productions", Phone = "0369258471" }
};
}