Sometimes my gridview has ItemSource count = 10, but items.count = 0. Sometimes the counts are same. I remembered someone has posted some similar issue but I can't find it any more. Any answers? Also, when should I use grid.Rebind() function?
1 Answer, 1 is accepted
answered on 12 Nov 2009, 07:46 AM
Hi sum sum,
There are cases where the Items.Count will not be the same as the total number of items of the data source. The reason for that is that Items.Count reflects the number of items that RadGridView is actually displaying - for example if you filter the grid the Items.Count will reflect the number of items that are passing the filter conditions.
In general we do not encourage the use of the Rebind method and if your data collection and items support change notifications you will never have to use the Rebind method. Rebind is usually used to refresh the grid when it is bound to a simple source collection, one that does not support change notifications, and that source collection is modified (for example an item is added). Rebind is one way to tell the grid to refresh itself and pickup the changes of the source collection.