hi i was using TelerikGrid and i ran to a problem
`
<TelerikGrid Data=@GridData
FilterMode="@GridFilterMode.FilterMenu"
ScrollMode="@GridScrollMode.Virtual"
Height="400px" RowHeight="40" PageSize="20"
>
`
this is my grid and it works fine but when use OnRead
`
<TelerikGrid Data=@GridData
FilterMode="@GridFilterMode.FilterMenu"
ScrollMode="@GridScrollMode.Virtual"
Height="400px" RowHeight="40" PageSize="20"
OnRead="()=> { }">
`
i dont even need to do something in that function i give ity an empty function suddenly whenever i scroll to it just shows me first 15
when i scroll i can see other options but suddenly 1 to 15 jumps up and all i see is them but scroll doesnt go to first of grid
and this is my whole code
<style>
.read{
color:red;
}
.not-yet{
color:green;
}
</style>
<TelerikGrid Data=@GridData
FilterMode="@GridFilterMode.FilterMenu"
ScrollMode="@GridScrollMode.Virtual"
Height="400px" RowHeight="40" PageSize="20"
Class="@(isRead ?"read" : "not-yet")"
OnRead="()=> { }">
<GridColumns>
<GridColumn Field="Id" />
<GridColumn Field="Name" Title="First Name" />
<GridColumn Field="LastName" Title="Last Name" />
<GridColumn Field="HireData">
<Template>
@(((SampleData)context).HireDate.ToString("MMMM dd, yyyy"))
</Template>
</GridColumn>
</GridColumns>
</TelerikGrid>
@code {
public List<SampleData> GridData { get; set; }
public bool isRead = false;
protected override async Task OnInitializedAsync()
{
GridData = await GetData();
}
private async Task<List<SampleData>> GetData()
{
return Enumerable.Range(1, 100).Select(x => new SampleData
{
Id = x,
Name = $"name {x}",
LastName = $"Surname {x}",
HireDate = DateTime.Now.Date.AddDays(-x)
}).ToList();
}
async Task Test()
{
isRead = true;
}
public class SampleData
{
public int Id { get; set; }
public string Name { get; set; }
public string LastName { get; set; }
public DateTime HireDate { get; set; }
}
}