I would like to set increase the searchbox width with a parameter.
---
ADMIN EDIT
Here is a CSS workaround:
<style>
.custom-searchbox-width .k-grid-search {
width: 50%;
}
</style>
<TelerikGrid Data=@GridData Pageable="true" Height="400px" Class="custom-searchbox-width">
<GridToolBar>
<span class="k-toolbar-spacer"></span> @* add this spacer to keep the searchbox on the right *@
<GridSearchBox />
</GridToolBar>
<GridColumns>
<GridColumn Field="@(nameof(Employee.EmployeeId))" />
<GridColumn Field=@nameof(Employee.Name) />
<GridColumn Field=@nameof(Employee.Team) Title="Team" />
<GridColumn Field=@nameof(Employee.IsOnLeave) Title="On Vacation" />
</GridColumns>
</TelerikGrid>
@code {
public List<Employee> GridData { get; set; }
protected override void OnInitialized()
{
GridData = new List<Employee>();
var rand = new Random();
for (int i = 0; i < 15; i++)
{
GridData.Add(new Employee()
{
EmployeeId = i,
Name = "Employee " + i.ToString(),
Team = "Team " + i % 3,
IsOnLeave = i % 2 == 0
});
}
}
public class Employee
{
public int EmployeeId { get; set; }
public string Name { get; set; }
public string Team { get; set; }
public bool IsOnLeave { get; set; }
}
}
---