Dear all,
first of all please do not confuse with my question title.It is a single seleteditem on Multiple datagrid ( notmultipleselecteditems on a single datagrid)
I have multiple datagrids ( say three ), each datagrid from the lowest depends for its data from the selecteditem from the above datagrid.
I have asked questions on selecteditem on datagrid by populating the data from a sqlserver few weeks ago, and i managed to solve this issue with some answers.
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/76ad5efe-0589-417d-9ffe-5c5911ffd520/#d884f0c8-a809-4358-b8e1-3b177ef3c48d
is it possible to use the same selecteditem of a datagrid on multiple datagrid's ?
for example , in the previous problem it was only 1:1 datagrid, will it be possible to implement the same concept like there are three datagrids,
This is my MainViewModel for the previous selecteditem 1:1 datagrid's
public class MainViewModel : BindableBase, INotifyPropertyChanged { public MainViewModel() { this.Persons = Person.GetPersons(); } // for Person Datagrid private ObservableCollection<Person> personValues; public ObservableCollection<Person> Persons { get { return personValues; } set { this.SetProperty<ObservableCollection<Person>>(ref this.personValues, value); } }
// for PersonDetail datagrid private ObservableCollection<PersonDetails> detailsvalues; public ObservableCollection<PersonDetails> Details { get { if (this.Selectedperson == null) { return null; } return this.LoadDetails(this.Selectedperson.PersonID); } } private ObservableCollection<PersonDetails> LoadDetails(int personID) { ObservableCollection<PersonDetails> details = new ObservableCollection<PersonDetails>(); foreach (PersonDetails detail in PersonDetails.GetDetails().Where(item => item.PersonID == personID)) { details.Add(detail); } return details; } private Person selectedPersonValue; public Person Selectedperson { get { return selectedPersonValue; } set { this.SetProperty<Person>(ref this.selectedPersonValue, value); this.RaiseNotification("Details"); } } }
any body suggest me to proceed further for the third datagrid. if somebody doesn't understand my question, pls tell me, i will try to explain it better.
Thanks