|
<EjsGrid @ref="DefaultGrid" DataSource="@Employees" AllowPaging="true" Height="315" AllowFiltering="@GridFilterEnable">
<GridColumns>
<GridColumn Field=@nameof(EmployeeData.EmployeeID) TextAlign="TextAlign.Right" Width="120" AllowFiltering=@EmployeeIDFilter>
<HeaderTemplate>
<div>
Product Key <span class="e-search-icon e-icons" @onclick="onclick"></span>
</div>
</HeaderTemplate>
</GridColumn>
...
</GridColumns>
</EjsGrid>
@code{
EjsGrid<EmployeeData> DefaultGrid;
public bool EmployeeIDFilter = true;
public bool GridFilterEnable = false;
public List<EmployeeData> Employees { get; set; }
public void onclick()
{
if(DefaultGrid.AllowFiltering)
EmployeeIDFilter = false; //Change the property value for GridColumn's AllowFiltering property
GridFilterEnable = true; //Change the property value for Grid's AllowFiltering property
}
...
}
|