|
<Syncfusion.Blazor.Buttons.SfButton OnClick="OnClick">Select Row of index 7</Syncfusion.Blazor.Buttons.SfButton>
<SfGrid ID="ParentGrid" @ref="ParentGrid">
..
</SfGrid>
<SfGrid @ref="ChildGrid" ID="ChildGrid">
..
</SfGrid>
@code{
SfGrid<Order> ChildGrid;
SfGrid<EmployeeData> ParentGrid;
public async Task OnClick()
{
await ChildGrid.SelectRow(7);
await JSRuntime.InvokeAsync<object>("scroll", 7, ChildGrid.ID); //here 7th is the row index to be selected
} |
|
window.scroll = function (index, id) {
var grid = document.getElementById(id).blazor__instance;
var rowHeight = grid.getRows()[index].scrollHeight;
grid.getContent().scrollTop = rowHeight * index;
//do the calculations to set the scrollTop value for grid content
} |
|
<head>
<script src="~/interop.js"></script>
</head> |