private void SelectedWellsTreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) { if (e.OldValue != null) { Graphic g = e.OldValue as Graphic; g.UnSelect(); g.SetZIndex(0); } if (e.NewValue != null) { Graphic g = e.NewValue as Graphic; g.Select(); g.SetZIndex(1); //Relationship query RelationshipParameter relationshipParameters = new RelationshipParameter() { ObjectIds = new int[] { Convert.ToInt32(g.Attributes[SelectedWellsTreeView.Tag as string]) }, //HOW DO YOU SET UP THE .TAG OutFields = new string[] { "loc_id, count_id, _year, adt" }, RelationshipId = 3, //WHAT IS THE RELATIONSHIP ID OutSpatialReference = Map.SpatialReference }; queryTask.ExecuteRelationshipQueryAsync(relationshipParameters); } }Solved! Go to Solution.