"We have 100 items and Total Price is 100.000USD - Filtered 90 items 90000USD - displaying only 50 records and 50.000USD"
You could refer to the following SQL statement to calculate total price for each page.
select count(1)*1000 from YourTable where Id in (select top @pagesize Id from YourTable where Id not in (select top ((@currentpage-1)* @pagesize) Id from YourTable))
Best Regards,
Fei Han
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
149 Points
807 Posts
Get Total Price from all selected/filtered records.
Apr 15, 2015 02:05 PM|omerdemir|LINK
Hello
My GridView has PageSize = Enabled
My SqlDataSource has "onSelecting" event and also Parameters and ControlParameters Enabled.
User filtering database and GridView displaying paged results.
I want to display some spesific values from this filtered results.
"We have 100 items and Total Price is 100.000USD - Filtered 90 items 90000USD - displaying only 50 records and 50.000USD"
I can display total records via DataView, also displaying paged records too.
But how can get filtered total records and price I dont know.
How can I get this filtered results and display it?
Thanks in advance.
All-Star
40565 Points
6233 Posts
Microsoft
Re: Get Total Price from all selected/filtered records.
Apr 15, 2015 10:24 PM|Fei Han - MSFT|LINK
Hi omerdemir,
Thanks for your post.
You could refer to the following SQL statement to calculate total price for each page.
Best Regards,
Fei Han
Member
149 Points
807 Posts
Re: Get Total Price from all selected/filtered records.
Apr 16, 2015 02:56 AM|omerdemir|LINK
Hello and thank you for your reply,
It was my mistake.
This codes worked fine.
Regards.