Can a Gridview be loaded with the result of a task?

Leonidas Carranza Oliva 1 Reputation point
2021-07-06T22:00:02.13+00:00

HI, I am trying to load a Gridview with the result of a query to Onedrive using Microsoft Graph, but it gives me the following error: The type System.Threading.Tasks cannot be loaded implicitly. I don't know if I have to convert the variable first, if another procedure is performed or if there is another way to do it.
Thanks.

private async Task Nube()
 {
    var Usuario = new GraphServiceClient(new 
    DelegateAuthenticationProvider(async Request =>

    {
       Request.Headers.Authorization = new 
       System.Net.Http.Headers.AuthenticationHeaderValue("Leonidas", "Token");
      }));

        var archivo = Usuario.Me.Drive.Root.Children
        .Request()
        .GetAsync()
        .Result
         ;


         GridView1.DataSource = archivo;
         GridView1.DataBind();
      }
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,715 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,288 questions
{count} votes