Skip to content

How to get grid data #18

Answered by zdrawku
JoeCSolomon asked this question in Q&A
Discussion options

You must be logged in to vote

As our dev team has replied in Discord:

You could use a strategy like this:

protected async void onButtonClick(MouseEventArgs args)
    {
        var view = await JSRuntime.InvokeAsync<string[]>("getCurrentView", "dataGrid1");

        Dictionary<string, CountryStatsItem> primaryKeyMap = new Dictionary<string, CountryStatsItem>();
        for (var i = 0; i < CountryStats.Count; i++)
        {
            primaryKeyMap[CountryStats[i].Code] = CountryStats[i];
        }
        List<CountryStatsItem> dataView = new List<CountryStatsItem>();
        for (var i = 0; i < view.Length; i++)
        {
            dataView.Add(primaryKeyMap[view[i]]);
        }

        Debug.WriteLine(dataView.Co…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by zdrawku
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants