Ron

Ron

  • NA
  • 44
  • 64.3k

Moving record pointer in listview

May 8 2012 2:55 PM
I'm coding in WPF...

I have a dataset containing 2 datatables with a relationship set with this code:

ds.Relations.Add("rltPeople", ds.Tables["People"].Columns["intID"], ds.Tables["Details"].Columns["intID"]);

The People table is the item source for a listview: lvwPeople.ItemsSource = People.DefaultView;
and the columns have bindings set with (Xaml)  DisplayMemberBinding="{Binding intID}"

Additionally I have several text boxes to display the data in the Details table, set up as (example):
txtEmail.DataContext = Details;
and (Xaml) Text="{Binding strEmail}"

I'm a novice at WPF, and I'm certain that there must be a better way to bind the text box data, but none the less, this all works in that the data is displayed properly.

But what I was expecting to happen is when I move thru the items in the listview, the appropriate record in the text boxes would display the corresponding data as stipulated in the rltPeople relationship. It does not.

I spent years working with Foxpro, and I suppose it was silly of me to think that this problem would be solved with a couple of lines of code. Could one of you good folks nudge me in the right direction?