I have a basic viewer that allows executive management level staff to select features and view the information in a FeatureDataGrid. My end users want to be able to view attachments that are associated with the features so we are looking to add the attachment grid but we want to have it function/interact with the FeatureDataGrid. Here???s the tasks/steps:Added a new customized button to the featuredataGrid that opens the attachment editor window.But what I???m having trouble with is I want to use the FeatureDataGrid_SelectionChangedEvent to active the attachment grid and populate with the feature???s attachment. Would you take a look and let me know what is wrong (I'm sure a bunch:)) I've been trying this for hours now and I'm getting really twisted.ThanksDave #region AttachmentLinking
private void FeatureDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var graphics = (sender as ESRI.ArcGIS.Client.Toolkit.FeatureDataGrid).SelectedGraphics;
//foreach (Graphic feature in graphics)
foreach (var g in graphics)
{
//// get id
//var id = g.Attributes["PICS"];
//// TODO: retrieve outside data for this id
//HYPERIDPASS.Text = string.Format("{0}", id);
//break;
//foreach (var edit in e.Edits)
//{
//if (feature.Attributes is FeatureLayer)
//{
// //if (e.Action == Editor.EditAction.Add || edit.Graphic.Selected)
//{
if (_lastGraphic != null)
_lastGraphic.UnSelect();
g.Select();
if (g.Selected)
QueryDetailsDataGrid.ScrollIntoView(g, null);
_lastGraphic = g;
// MyAttachmentEditor.FeatureLayer = feature.Attributes as FeatureLayer;
MyAttachmentEditor.FeatureLayer = graphics as FeatureLayer;
MyAttachmentEditor.GraphicSource = g;
// MyAttachmentEditor.GraphicSource = g.Graphic;
// }
// }
//}
}
}
#endregion