void GroupItems_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { foreach (SchedulerGroupItem group in Scheduler.GroupItems) { if (group.Owner != null) { // set SchedulerGroupItem.Tag property to the data row. That allows to use data row fields in xaml for binding int index = (int)group.Owner.Key[0]; MultiUser.NwindDataSet.EmployeesRow row = dataSet.Employees.Rows.Find(index) as MultiUser.NwindDataSet.EmployeesRow; group.Tag = row; } } }
void Owners_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Add) { foreach (Contact cnt in e.NewItems) { MultiUser.NwindDataSet.EmployeesRow row = dataSet.Employees.Rows.Find(cnt.Key[0]) as MultiUser.NwindDataSet.EmployeesRow; if (row != null) { // set Contact.MenuCaption to the FirstName + LastName string cnt.MenuCaption = row["FirstName"].ToString() + " " + row["LastName"].ToString(); } } } }