If you create a second Grid on the page, it will clear the SearchBox input value of the first Grid.
<p><TelerikButton OnClick="@ToggleSecondGrid">Toggle Second Grid</TelerikButton></p>
<TelerikGrid Data="@GridData">
<GridToolBar>
<GridSearchBox />
</GridToolBar>
<GridColumns>
<GridColumn Field=@nameof(Product.ProductName) Title="Product Name" />
</GridColumns>
</TelerikGrid>
@if (ShowSecondGrid)
{
<TelerikGrid Data="@( new List<Product>() )">
<GridColumns>
<GridColumn />
</GridColumns>
</TelerikGrid>
}
@code {
List<Product> GridData { get; set; }
bool ShowSecondGrid { get; set; }
async Task ToggleSecondGrid()
{
ShowSecondGrid = !ShowSecondGrid;
}
protected override void OnInitialized()
{
GridData = new List<Product>();
for (int i = 1; i <= 5; i++)
{
GridData.Add(new Product()
{
ProductId = i,
ProductName = "Product " + i.ToString(),
UnitPrice = (decimal)(i * 3.14),
UnitsInStock = (short)(i * 1),
Discontinued = false
});
}
}
public class Product
{
public int ProductId { get; set; }
public string ProductName { get; set; }
public decimal? UnitPrice { get; set; }
public short? UnitsInStock { get; set; }
public bool Discontinued { get; set; }
}
}