Mewriick / Blazor.FlexGrid

GridView component for Blazor
MIT License
198 stars 36 forks source link

How to use Flexgrid on a 3.1 project without startup file ? #106

Closed Methraen closed 4 years ago

Methraen commented 4 years ago

Hello there, @Mewriick

How can we :

public void ConfigureServices(IServiceCollection services)
{
    services.AddFlexGrid();
}

When there is no longer a startup file in the last 3.1 projects ?

I tried :

public static async Task Main(string[] args)
    {
      var builder = WebAssemblyHostBuilder.CreateDefault(args);
      builder.RootComponents.Add<App>("app");

      builder.Services.AddBaseAddressHttpClient();
      builder.Services.AddFlexGrid();

      await builder.Build().RunAsync();
    }

But it does not seem to work...

Mewriick commented 4 years ago

Hello @Methraen

Here is example which should work correctly. https://github.com/Mewriick/Blazor.FlexGrid/blob/master/demo/Blazor.FlexGrid.Demo.Client/Program.cs

I do not see any problems in your configuration, can you please send me the error ?

Methraen commented 4 years ago

I must miss something basic but vital, i didn't used Flexgrid for a month and now im lost x) Here is my error:

Error CS1061 'IServiceCollection' does not contain a definition for 'AddFlexGrid' and no accessible extension method 'AddFlexGrid' accepting a first argument of type 'IServiceCollection' was not found (a using directive or an assembly reference is- missing?)

I added the references in the html file but did not install it as a nuget package it may come from that... (i did not 'cause i cant: i have a 400 bad request error when i try)

Mewriick commented 4 years ago

In your client project you have to install FlexGrid nuget package

Methraen commented 4 years ago

Its solved, i had a problem with one of my package source, that's why i got 400 bad request while i tried to install FlexGrid as a nuget package. Thank you and have a good day.