I have a requirement like, we are displaying a datatable from sql database (which has more than 50000 records), so i used paged view to display those records.
so when applying filter for any column, we need to calculate the no. of rows and also the sum of the elements in the column say
"size" column in code behind. i gone through some demos where they are displaying the count and sum in the footer. my requirement is different. kindly help.
Note: I am using WCF RIA services.
Thanks in advance
Ganesh
10 Answers, 1 is accepted
Ganesh
Generally, the Items collection will return the elements after the grid has been filtered. So, if you get the count of that collection, you will get the number you require. Considering your second requirement, in case you decide on using the SumFunction as an aggregate function, you will get the sum after filtering.
Maya
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
Thank you so much for your reply.
As you said i am able to get the sum of column values using SumFunction in the footer of the colum (if i enable showcolumnfooters).
My requirement is to display the sum and count values in separate text boxes. so i need to do coding in the code behind file.
it would be more helpful if you provide any sample code.
Thanks in advance
Ganesh
Adding some more point related to my requirement,
we are displaying our data base as a paged view, so need to get the row count as well as the sum value for the entire database.
Thanks in advance
Ganesh
I would recommend you to run through our online demos considering aggregates (link1, link2, link3).
Maya
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
Thanks for your reponse, I already went through those demos.
My requirement not involved any grouping activity..
My exact requirements are:
A radgridview will be displayed more than 50000 records [10000 records in each page], when an user applying any filters in the column, after that say for example the result contains 25000 records [will display in 3 pages]. I need to display the no. of rows[25000] in a separate texbox and sum of the column[25000] values in another text box.
i reviewed all the demos available in telerik link..nothing helped me..
please do the needfull
Thanks in advance
Ganesh
Hi Maya,
FYR
<telerik:GridViewDataColumn Header="Size" UniqueName="R_SIZE" DataMemberBinding="{Binding R_SIZE, Mode=OneTime}"> <telerik:GridViewDataColumn.AggregateFunctions> <telerik:CountFunction Caption="Count:" FunctionName="CountFunction"/> <telerik:SumFunction Caption="Sum: " SourceField="R_SIZE" FunctionName="SumFunction"/> </telerik:GridViewDataColumn.AggregateFunctions> </telerik:GridViewDataColumn>part of my .xaml file where i include sum function and count function.
Kindly reply..
Thanks
Ganesh
Regards
Ganesh
Thanks
Ganesh
The CountFunction and SumFunction will return the values for all items in the collection. So, the result of the CountFunction will give you all the available items and the SumFunction - the sum of the all items (after the filtering is applied).
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>