<EjsGrid DataSource="@Employees">
<GridColumns>
<GridColumn Field="FirstName" HeaderText="Employee Name" TextAlign="TextAlign.Center" Width="120">
<Template>
@{
<span @onclick="Clicked">@(context as EmployeeData).FirstName</span>
}
</Template>
</GridColumn>
. . . . . .. . .
</GridColumns>
</EjsGrid>
@code{
public List<EmployeeData> Employees { get; set; }
public void Clicked(MouseEventArgs Args)
{
// perform your action here, open a dialog here
} |
Hello ! I try to follow the method in my own project, but I keep getting this error. What do I do wrong ?
Thanks in advance !
<SfGrid DataSource="@Employees">
<GridColumns>
<GridColumn Field=@nameof(EmployeeData.EmployeeID) TextAlign="TextAlign.Center" HeaderText="Employee ID" Width="120"></GridColumn>
<GridColumn HeaderText="User profile" TextAlign="TextAlign.Center" Width="120">
<Template>
@{
var Employee = (context as EmployeeData);
<div><a rel='nofollow' href="#" @onclick="@(() => Navigate(Employee))">View</a></div>
}
</Template>
</GridColumn>
</GridColumns>
</SfGrid>
|
Thank you for noticing the error!