.NET Programming
--
Questions
--
Followers
Top Experts
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
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
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
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
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






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
.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.