Solved

WPF binding - How to bind direction of CollectionViewSource

Posted on 2012-03-24
6
912 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

Technology Partners: 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
c#, case, if 4 35
Help with Report Viewer in VS2013 6 26
MessageBox Appear behind a form in Runtime 1 26
.NET universe documentation poster 2 16
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

738 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