Solved

WPF binding - How to bind direction of CollectionViewSource

Posted on 2012-03-24
6
876 Views
Last Modified: 2012-04-19
Hi,

I am unable to bind the Direction property of a CollectionViewSource to a dependency property in my MainWindow.Xaml.cs

I get an error that "Binding must be to a dependency property".. and it is...


CollectionViewSource x:Key="peopleView" x:Name="peopleView"
                                  Source="{Binding Source={StaticResource people}}">
                <CollectionViewSource.SortDescriptions>
                    <scm:SortDescription PropertyName="Name" Direction="{Binding ?????}">


                    </scm:SortDescription>

                </CollectionViewSource.SortDescriptions>

            </CollectionViewSource>
0
Comment
Question by:vamail2
  • 3
6 Comments
 
LVL 14

Expert Comment

by:nishant joshi
Comment Utility
might you have forgot the Path property...
0
 

Author Comment

by:vamail2
Comment Utility
No.   the question marks were just placeholders for posting this example
0
 
LVL 16

Accepted Solution

by:
SriVaddadi earned 500 total points
Comment Utility
Direction is not a dependency property and hence you cannot bind to it. Alternatively, you could create a data triggner to set the Direction based on a value.
0
 

Author Comment

by:vamail2
Comment Utility
Thanks SriVaddadi - excellent.
0
 

Author Closing Comment

by:vamail2
Comment Utility
Thanks SriVaddadi
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now