Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6531029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:49:42+00:00 2026-05-25T09:49:42+00:00

Is it possible in MVC3 (Razor if possible) to have a page rendered with

  • 0

Is it possible in MVC3 (Razor if possible) to have a page rendered with totals and subtotals?

e.g.
I have 5,000 rows in my db table retreived through EF4/L2E.

Type    Category   Product        Month1   Month2   Month3
_______________________________________________________________
Foo     Large      Big Foo        64       32       16
Foo     Large      Massive Foo    18        9        4
Foo     Small      Foolet        120      110      120
Foo     Small      Fooling       200      210      220
Foo     Medium     Standard Foo  100      100      100
Bob     Small      Bobbling        6        5        4
Bob     Medium     Bobble          8        6        4

Is it possible to get a page to render:

Type    Category   Month1    Month2...
Foo                502       461
        Large       82        41
        Small      320       320
        Medium     100       100
Bob                 14        11
        Small        6         5
        Medium       8         6

Do I need to create a set of view models, one for Type, one for Category etc?

I’ve looked at page layouts, but they don’t seem to be what I need?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:49:42+00:00Added an answer on May 25, 2026 at 9:49 am

    You can achieve this with MVC WebGrid by nesting two webgrids.

    Razor Nested WebGrid

    You can have single ViewModel containing instance of Type and Category model.

    To show the Total in both webgrids, use LINQ. Get the Sum for each Category and Type in TypeModel and CategoryModel.
    Check the “Sum -Grouped” example in following link.

    http://msdn.microsoft.com/en-us/vcsharp/aa336747

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC3 web application with C# and Razor. Through a form
I had created a webpage using asp.net mvc3 razor. I have two master pages
Possible Duplicate: Emitting unencoded strings in a Razor view I have a string that
I have online form builder appplication in ASP.NET MVC3 with Razor views. It is
I am using EF4 + MVC 3 with Razor. I have the following ActionResult
I have a mvc3 razor helper that show a component: @helper Component(string params){ <div
I'm building a Asp.net MVC3 aplication (with Razor) and I have a Data Base
I have an MVC 3 Razor partial page that is dependent on jquery.validate.js and
I have some MVC3 Razor code. I am not so familiar with Razor but
In a .NET MVC3 Razor webapplication, how is it possible to use an EditorTemplate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.