I tried a lot of things to make this work and I found one. It's not the best way of doing this, but it works. I anyone has anything better, just post here! Share with us!
I'm trying to iterate through my RadGridView rows, but when I have more than 20 or 30 items, the loop doesn't get all rows.
For example: using this code in a radgridview with 5 items, I can get all of them and do whatever I want, but when my grid has more than 20 items, it gets only 10 rows. Is this a bug or something like that? How can I solve it?
Here's my code:
01.private List<object> ReturnListFounds(string text)02. {03. List<object> a = new List<object>();04. foreach (var item in myGrid.Items)05. {06. if (item == null)07. continue;08. GridViewRow row = myGrid.ItemContainerGenerator.ContainerFromItem(item) as GridViewRow;09. 10. if (row == null)11. continue;12. 13. foreach (GridViewCell cell in row.Cells)14. {15. if (cell != null && cell.Value != null)16. {17. string str = cell.Value.ToString();18. 19. if (str.Equals(text, StringComparison.InvariantCultureIgnoreCase) || str.ToLower().Contains(text.ToLower()))20. {21. a.Add(row.Item);22. break;23. }24. }25. }26. }27. 28. return a;29. }