internal void ShowFarDropMark(Point mousePosition) { int itemsCount = this.Items.Count; if (itemsCount < 1) { if (m_dropMarkAdorner == null) { DataGridContext dataGridContext = DataGridControl.GetDataGridContext(this); DataGridControl grid = (dataGridContext != null) ? dataGridContext.DataGridControl : null; Pen pen = UIViewBase.GetDropMarkPen(this); if ((pen == null) && (grid != null)) { UIViewBase uiViewBase = grid.GetView() as UIViewBase; pen = uiViewBase.DefaultDropMarkPen; } DropMarkOrientation orientation = UIViewBase.GetDropMarkOrientation(this); if ((orientation == DropMarkOrientation.Default) && (grid != null)) { UIViewBase uiViewBase = grid.GetView() as UIViewBase; orientation = uiViewBase.DefaultDropMarkOrientation; } m_dropMarkAdorner = new DropMarkAdorner(this, pen, orientation); AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this); if (adornerLayer != null) { adornerLayer.Add(m_dropMarkAdorner); } } // We Only want the drop mark to be displayed at the end of the HierarchicalGroupByControlNode m_dropMarkAdorner.ForceAlignment(DropMarkAlignment.Far); } else { HierarchicalGroupByItem hierarchicalGroupByItem = this.ItemContainerGenerator.ContainerFromIndex(itemsCount - 1) as HierarchicalGroupByItem; Debug.Assert(hierarchicalGroupByItem != null); GroupLevelDescription groupLevelDescription = hierarchicalGroupByItem.Content as GroupLevelDescription; Debug.Assert(groupLevelDescription != null); // Show Far DropMark only if not already grouped if (this.Items.Contains(groupLevelDescription) == false) { hierarchicalGroupByItem.ShowFarDropMark(mousePosition); } } }
internal void ShowFarDropMark(ColumnManagerCell cell, Point mousePosition) { Debug.Assert(cell != null); if (cell == null) { return; } DataGridContext cellDataGridContext = DataGridControl.GetDataGridContext(cell); Debug.Assert(cellDataGridContext != null); if (cellDataGridContext == null) { throw new DataGridInternalException("DataGridContext cannot be null on ColumnManagerCell."); } // We already have GroupLevelDescriptions for this level, we should show DropMark on the last HierarchicalGroupByItem if (cellDataGridContext.GroupLevelDescriptions.Count > 0) { Debug.Assert(cellDataGridContext.GroupLevelDescriptions == this.GroupLevelDescriptions); if (cellDataGridContext.GroupLevelDescriptions != this.GroupLevelDescriptions) { return; } int lastIndex = this.GroupLevelDescriptions.Count - 1; // If there if (lastIndex > -1) { HierarchicalGroupByItem hierarchicalGroupByItem = this.ItemContainerGenerator.ContainerFromItem(this.GroupLevelDescriptions[lastIndex]) as HierarchicalGroupByItem; Debug.Assert(hierarchicalGroupByItem != null); if (hierarchicalGroupByItem == null) { return; } hierarchicalGroupByItem.ShowFarDropMark(mousePosition); } else { this.ShowFarDropMark(mousePosition); } } else { this.ShowFarDropMark(mousePosition); } }