Avatar of Adam Collins
Adam Collins
 asked on

.Net Core 3 HtmlGrid WithFooter not an option

I am a noob when it comes to .Net Core and I was asked to upgrade an existing project from Core 2.2 to 3.1. I have been slowly working though the issues but this one I can not find any help on.

I am getting an error:

CS1061 'IHtmlGrid' does not contain a definition for 'WithFooter' and no accessible extension method 'WithFooter' accepting a first argument of type 'IHtmlGrid' could be found (are you missing a using directive or an assembly reference?)

Here is the full page code from my FollowupOnTimeGrid.cshtml:


@(Html.Grid(Model)
    .Build(c =>
    {
        c.Add(m => m.SurveyDateRange).Titled("Survey Period").InitialSort(GridSortOrder.Asc);
        c.Add(m => m.Due);
        c.Add(m => String.Format("{0} ({1:f2}%)", m.OnTime, m.Due == 0 ? 0 
           : Math.Round((((double)m.OnTime) / m.Due) * 100.0, 2)))
                 .Titled("Surveys Taken on Time (N (%))");
    })
    .Css("table-striped table-bordered table-hover")
    .Named("FollowupOnTimeGrid")
    .Empty("No Records Found!")
    .WithFooter("_FollowupOnTimeGridFooter")
)

Open in new window

.NET Programming* asp.net core mvcAssembly

Avatar of undefined
Last Comment
Adam Collins

8/22/2022 - Mon
Arana (G.P.)

Are you referencing the new version of the library?

have you tried dotnet clean and rebuild?
Adam Collins

ASKER

I made sure all the packages in NuGet are up to date.  I also tried the clean and build to no effect.

Chinmay Patel

Hi Adam,


IHtmlGrid is used by couple of other controls as well. Are you using NonFactor's Grid? Or something else?


Regards,

Chinmay.

Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Adam Collins

ASKER

This is the .csproj file with all the includes.  It looks like there are a couple "Grid" references.

  <Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <StartupObject />
    <UserSecretsId>4f66[edited]a757</UserSecretsId>
    <GenerateProgramFile>false</GenerateProgramFile>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DefineConstants>TRACE</DefineConstants>
  </PropertyGroup>

  <ItemGroup>
    <None Remove="Properties\PublishProfiles\C [edited] Profile.pubxml" />
    <None Remove="Properties\PublishProfiles\F [edited] Profile.pubxml" />
    <None Remove="Properties\PublishProfiles\ [edited] PortalTest - Web Deploy.pubxml" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="EPPlus" Version="4.5.3.3" />
    <PackageReference Include="Localization.AspNetCore.TagHelpers" Version="0.6.0" />
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="3.1.2" />
    <PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Hosting.Server.Abstractions" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="3.1.2" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.2">
      <PrivateAssets>All</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="2.0.0-preview1-final" />
    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.2" />
    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.2" />
    <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="3.1.2" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.2" />
    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.2" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.2" />
    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.2" />
    <PackageReference Include="Microsoft.Extensions.Primitives" Version="3.1.2" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.3" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
    <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.2.0" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" />
    <PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.0.96" />
    <PackageReference Include="NonFactors.Grid.Core.Mvc6" Version="5.1.2" />
    <PackageReference Include="Sendgrid" Version="9.12.7" />
  </ItemGroup>

  <Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
    <Exec Command="dotnet bundle" />
  </Target>

  <ItemGroup>
    <DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.2.301" />
    <DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
    <DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\DataAccess\DataAccess.csproj" />
  </ItemGroup>

  <ItemGroup>
    <Content Update="Views\Report\_DataReportsGrid.cshtml">
      <Pack>$(IncludeRazorContentInPack)</Pack>
    </Content>
    <Content Update="wwwroot/lib\bootstrap-select\dist\js\i18n\defaults-en_US.js">
      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Update="Resources\Controllers\[edited].en.resx">
      <Generator>ResXFileCodeGenerator</Generator>
    </EmbeddedResource>
...
... ...     <EmbeddedResource Update="Resources\Views\Shared\_[edited].es.resx">
      <Generator>ResXFileCodeGenerator</Generator>
    </EmbeddedResource>
  </ItemGroup>

  <ItemGroup>
    <Folder Include="Properties\PublishProfiles\" />
  </ItemGroup>

</Project>

Open in new window


Chinmay Patel

Hi Adam,

NonFactors is a grid component. SendGrid is a service to send out mass emails.

Regards,
Chinmay.
ASKER CERTIFIED SOLUTION
Adam Collins

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Adam Collins

ASKER
I found ther version it changed it was in from 6 to 7
https://github.com/NonFactors/MVC5.Grid/issues/80 
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.