Solved

WPF binding - How to bind direction of CollectionViewSource

Posted on 2012-03-24
6
900 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
ID: 37762138
might you have forgot the Path property...
0
 

Author Comment

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

Accepted Solution

by:
SriVaddadi earned 500 total points
ID: 37847039
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
ID: 37866683
Thanks SriVaddadi - excellent.
0
 

Author Closing Comment

by:vamail2
ID: 37866691
Thanks SriVaddadi
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

856 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