hi
im tring to recieve number of rows after filtering
i found this example : http://www.telerik.com/help/silverlight/gridview-filtered-event.html
but i don't have the Records property on my RedGridView element
how can i receive number of rows?
im tring to recieve number of rows after filtering
i found this example : http://www.telerik.com/help/silverlight/gridview-filtered-event.html
but i don't have the Records property on my RedGridView element
how can i receive number of rows?
5 Answers, 1 is accepted
0
Hello Guy,
Please excuse us for any inconvenience caused!
All the best,
Vanya Pavlova
the Telerik team
Indeed this article is a bit out-dated. You should use RadGridView's Items property instead of Records within RadGridView's Filtered event handler:
MessageBox.Show(RadGridView1.
Items
.Count.ToString());
Please excuse us for any inconvenience caused!
All the best,
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Eric
Top achievements
Rank 1
answered on 03 Nov 2011, 03:21 PM
I found another issue (at least using the Q3 2010 controls). Using grid.Items.Count.ToString() will only give you a maximum of the page size -- not the entire amount of records.
0
Eric
Top achievements
Rank 1
answered on 03 Nov 2011, 03:21 PM
I found another issue (at least using the Q3 2010 controls). Using grid.Items.Count.ToString() will only give you a maximum of the page size -- not the entire amount of records.
0
Hi,
Vlad
the Telerik team
You can use TotalItemCount to get all items count.
Regards,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Eric
Top achievements
Rank 1
answered on 03 Nov 2011, 03:53 PM
Sorry for my brevity -- I didn't discuss my issue well enough.
Say you have a collection that spans 10 pages of 50 records each (500 total).
You filter it down, leaving you with 140 records (3 pages of 50). When you call grid.Items.Count.ToString() it will only return the number 50 -- the maximum size of the page. However, that value is wrong as you have 150 filtered records in total. How can I get this value of 140?
At first I was thinking of just multiplying by the number of pages, but in the case above I could still get a wrong number.
Edit: I figured it out. The (seemingly, I didn't count by hand) correct call to get the count of rows after a filter is
Using Items.Count will only retrieve at maximum the page size number, which is incorrect.
Say you have a collection that spans 10 pages of 50 records each (500 total).
You filter it down, leaving you with 140 records (3 pages of 50). When you call grid.Items.Count.ToString() it will only return the number 50 -- the maximum size of the page. However, that value is wrong as you have 150 filtered records in total. How can I get this value of 140?
At first I was thinking of just multiplying by the number of pages, but in the case above I could still get a wrong number.
Edit: I figured it out. The (seemingly, I didn't count by hand) correct call to get the count of rows after a filter is
RadGridView1.Items.ItemCount
Using Items.Count will only retrieve at maximum the page size number, which is incorrect.