'How to find CurrentPage in MudTable

I am using MudTable of MudBlazor. How can I read the value of currentpage of the table after using the function-event OnRowClick?



Solution 1:[1]

In this example:

<MudPagination SelectedChanged="pageChanged"
                       Count="@((Products.TotalProducts + 10 - 1) / 10)" />

When page changes, the pageChanged function is called. You can call any other methods inside pageChanged like this:

    private int CurrentPage { get; set;}
private async Task pageChanged(int i)
        {
            isReLoading = true;
            await Task.Delay(4000);
            CurrentPage = i;
            await LoadProducts(CurrentPage);
        }

When you use SelectedChanged, there is no need to specify a parameter while calling the function. But in your function, you should accept an int as input.

I load data from server dynamically while page changes, and it also shows a loader while data is loading.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Navid Yazdi