theSpyCry
theSpyCry

Reputation: 12283

Is CollectionViewSource in WPF optimal?

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?

Upvotes: 0

Views: 505

Answers (1)

Joachim Kerschbaumer
Joachim Kerschbaumer

Reputation: 9881

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...

Upvotes: 3

Related Questions