Solved

WPF binding - How to bind direction of CollectionViewSource

Posted on 2012-03-24
6
906 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
API v SOA 8 39
Visual Studio hangs on running project 6 59
ASP.NET/VB: Convert Date and Time to YYYY-MM-DDTHH:MM:SS 3 32
Need to sort columns in DataGridView 4 36
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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 …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

756 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