Click here to Skip to main content
15,890,512 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: silverlight - backgroundworker process Pin
arkiboys31-Aug-11 22:11
arkiboys31-Aug-11 22:11 
GeneralRe: silverlight - backgroundworker process Pin
Pete O'Hanlon31-Aug-11 23:18
mvePete O'Hanlon31-Aug-11 23:18 
GeneralRe: silverlight - backgroundworker process Pin
arkiboys31-Aug-11 23:38
arkiboys31-Aug-11 23:38 
GeneralRe: silverlight - backgroundworker process Pin
Pete O'Hanlon1-Sep-11 0:12
mvePete O'Hanlon1-Sep-11 0:12 
GeneralRe: silverlight - backgroundworker process Pin
arkiboys1-Sep-11 0:16
arkiboys1-Sep-11 0:16 
QuestionWindows Phone Pin
arkiboys31-Aug-11 7:43
arkiboys31-Aug-11 7:43 
QuestionMaster-Details binding of 2 related tables Pin
bitwise.csc31-Aug-11 2:29
bitwise.csc31-Aug-11 2:29 
AnswerRe: Master-Details binding of 2 related tables Pin
Wayne Gaylard31-Aug-11 4:32
professionalWayne Gaylard31-Aug-11 4:32 
Personally, I think you are going about things the wrong way. When it comes to WPF, as I told you before, using datasets and trying to bind to them is seriously a PITA. For a start, I would create 2 classes, one for Products and one for Categories. These can be really basic. The Category class should have a property that returns a List of Products. Then I would have another class (call it a viewmodel if you will) that would implement the INotifyPropertyChanged[^] Interface. This viewmodel need only have 2 properties, one which returns an ObservableCollection of Categories, call it Categories(to be original), and another that returns a specific Category (call it SelectedCategory). These properties should call your NotifyPropertyChanged event handler whenever they are changed. The viewmodel should also be able to populate the collection of categories, either from a database or some other source, or it could be populated in the constructor. Then in your Window/UserControl constructor, all you need to do is create an instance of the viewmodel class, and set the Window/UserControl's datacontext to the instance (this can be done in the constructor). In your XAML, you set up 2 ListViews. The first ListView should have it's ItemsSource property set to bind to the Categories property of the view model. The second ListView, the one with 2 columns for each property of the product, should have it's ItemsSource bound to the SelectedCategory's Products Property, with the first column bound to the product Id, and the second Column bound to the Name. And that's it, Simples.

Doing things this way, will make your life so easier. If you have any problems with implementing this, I will try and help if I can.
Live for today. Plan for tomorrow. Party tonight!

GeneralRe: Master-Details binding of 2 related tables Pin
bitwise.csc31-Aug-11 4:59
bitwise.csc31-Aug-11 4:59 
GeneralRe: Master-Details binding of 2 related tables Pin
Pete O'Hanlon31-Aug-11 5:15
mvePete O'Hanlon31-Aug-11 5:15 
GeneralRe: Master-Details binding of 2 related tables Pin
bitwise.csc31-Aug-11 5:21
bitwise.csc31-Aug-11 5:21 
QuestionNavigate in Frame from code Pin
yesu prakash30-Aug-11 19:34
yesu prakash30-Aug-11 19:34 
AnswerRe: Navigate in Frame from code Pin
Mycroft Holmes30-Aug-11 22:24
professionalMycroft Holmes30-Aug-11 22:24 
QuestionData binding model: "Main->Details" Pin
bitwise.csc29-Aug-11 3:14
bitwise.csc29-Aug-11 3:14 
AnswerRe: Data binding model: "Main->Details" Pin
Wayne Gaylard29-Aug-11 3:24
professionalWayne Gaylard29-Aug-11 3:24 
GeneralRe: Data binding model: "Main->Details" Pin
bitwise.csc29-Aug-11 3:30
bitwise.csc29-Aug-11 3:30 
GeneralRe: Data binding model: "Main->Details" Pin
Wayne Gaylard29-Aug-11 3:42
professionalWayne Gaylard29-Aug-11 3:42 
GeneralRe: Data binding model: "Main->Details" [modified] Pin
bitwise.csc29-Aug-11 3:51
bitwise.csc29-Aug-11 3:51 
GeneralRe: Data binding model: "Main->Details" Pin
bitwise.csc29-Aug-11 11:14
bitwise.csc29-Aug-11 11:14 
GeneralRe: Data binding model: "Main->Details" Pin
Wayne Gaylard29-Aug-11 22:03
professionalWayne Gaylard29-Aug-11 22:03 
QuestionTutorial to display Google Maps using WPF-WCF Pin
Member 819216328-Aug-11 5:24
Member 819216328-Aug-11 5:24 
AnswerRe: Tutorial to display Google Maps using WPF-WCF Pin
Abhinav S28-Aug-11 22:19
Abhinav S28-Aug-11 22:19 
QuestionRound corner border not that easy Pin
Zapacila27-Aug-11 22:36
Zapacila27-Aug-11 22:36 
QuestionA Combobox size within menu [modified] Pin
Saksida Bojan27-Aug-11 6:35
Saksida Bojan27-Aug-11 6:35 
AnswerRe: A Combobox size within menu Pin
Abhinav S27-Aug-11 7:02
Abhinav S27-Aug-11 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.