/// <summary> /// Selects/deselects related graphic objects in the GraphicsLayer /// when related grid rows have been selected/deselected by the user. /// </summary> /// <param name="rowsToLookup"></param> /// <param name="shouldSelectGraphics"></param> private void SelectGraphics(IList rowsToLookup, bool shouldSelectGraphics) { foreach (object objRow in rowsToLookup) { Graphic graphic = DataSourceCreator.GetGraphicSibling(objRow); if (graphic != null && GraphicsLayer != null && GraphicsLayer.Contains(graphic)) { graphic.Selected = shouldSelectGraphics; if (shouldSelectGraphics) { currentRecordNumber = GetRowIndexInRowsCollection(objRow); } else { if (SelectedGraphics.Count == 0) { currentRecordNumber = -1; } } } } }