Link to home
Create AccountLog in
.NET Programming

.NET Programming

--

Questions

--

Followers

Top Experts

Avatar of tfsaccount
tfsaccount🇺🇸

asp.net nested gridview subtotals
Hello,

How do I dynamically add a sub-total AND additional row(s) after that subtotal line?

For example, I have a cross-tab table, such as:
RecordID, Customer Name, FiscalYear,BudgetMargin,  P01_Sales, P01_Budget, P01_Delta, P02_Sales, total_Sales, TotalMargin, Total_Budget, RecordStatus

The RecordID is an auto increment field
The RecordStatus will either be "COMPLETE" or "INCOMPLETE"
If the recordstatis is Complete, the user will not be able to edit this record at all.  If its Incomplete, the fiscal year 2010 will be editable.
This field is set in the database.


The sub-total line is really going to be the Budged Margin % and the budget fields (P01_Budget, P02_Budget) and immediately after that budget line will be the delta (sum-budget) and totals on the right-hand side.

When they click Edit, they can only edit the budget fields.  I realize that its not standard on how this is displayed.  I tried to get them to use a side-by-side where the fields would show as P01 Sales P01 Budget P02 Sales P02 Budget etc, but that is definately a no-go.

I also need paging since there will (or could be) 2000-4000 records to go through.

I've attached a sample of what I mean... I didnt put all of the periods across the top, but there are 12 of them.

I know how to hide the Edit button based on the value of the status, but I can't figure out how to add that Delta row in there.  The delta will be calculated on SQL Server when the record is inserted/updated.  I only need it to show.  There may be additional rows below the delta, such as Forecast etc, but that is undetermined at the moment.

So, if the user sees the Edit button, they can click on it.  When they click on it, the row for 2010 will be editable.  When its saved, the values that are in there will be save to the budget fields.  I shaded the budget fields in grey so that you can see what fields I need to be able to edit.

Itss adding that Delta row that I am really struggling with right now.  That delta is only added at the end of the each customers records.

Any ideas?

sample.JPG

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of Nasir RazzaqNasir Razzaq🇬🇧

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

SOLUTION
Avatar of DeathraceDeathrace🇮🇳

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.

Avatar of tfsaccounttfsaccount🇺🇸

ASKER

Thanks for the links guys, I think I could do something like the links described, but I figured out a different way.

I did a union and the grid then didnt have to do anything at all, since the union returned the records in the correct order.  All I have to do is simply enable the edit on the Budget line and then update the data as normal.

Thanks!!
Rico

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

.NET Programming

.NET Programming

--

Questions

--

Followers

Top Experts

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.