views:

268

answers:

1

Many WPF examples use CollectionViewSource as DataSource for DataBinding. It provides sorting and other useful functions. My question is, shouldn't this be done in Database? I mean in SQL? I bet it's 10times quicker. Isn't CollectionViewSource too slow? Thanks

+2  A: 

sometimes you may not want additional roundtrips to a database especially if you want fast response times when grouping/sorting. Imagine a incremental search where non-fitting items get invisible while you type. In addition, your datasource may not always be a database. imagine XML, runtime objects, data from a webservice, etc...

Joachim Kerschbaumer
Thank u for great response. I understand now the usage of CollectionViewSource.
PaN1C_Showt1Me