/// <summary>
        /// Builds collectionSource DetailDescriptions.ItemProperties and collection of detail columns.
        /// </summary>
        /// <param name="collectionSource"></param>
        /// <param name="xceedControl"></param>
        /// <param name="detail"></param>
        public void BuildDetailStructure(DataGridCollectionViewSource collectionSource, DataGridControl xceedGrid,
                                          DetailConfiguration detail)
        {
            Debug.Assert(null != collectionSource.DetailDescriptions);
            Debug.Assert(1 == collectionSource.DetailDescriptions.Count);

            _BuildCollectionSource(collectionSource.DetailDescriptions[0].ItemProperties);
            _BuildColumnsCollection(detail.Columns);

            // Add stops as detail of route.
            xceedGrid.DetailConfigurations.Clear();
            xceedGrid.DetailConfigurations.Add(detail);

            // NOTE: Set this property so that columns with custom order properties from default
            // settings were not added to grid automatically.
            xceedGrid.DetailConfigurations[0].AutoCreateColumns = false;

            // Collapse all detail and reexpand it.
            List<DataGridContext> dataGridContexts = new List<DataGridContext>(xceedGrid.GetChildContexts());
            foreach (DataGridContext dataGridContext in dataGridContexts)
            {
                dataGridContext.ParentDataGridContext.CollapseDetails(dataGridContext.ParentItem);
                dataGridContext.ParentDataGridContext.ExpandDetails(dataGridContext.ParentItem);
            }
        }
        /// <summary>
        /// Gets all selected items list.
        /// </summary>
        /// <param name="xceed">Xceed control.</param>
        public IList _SelectedItemsFromAllContexts(DataGridControl xceed)
        {
            Debug.Assert(null != xceed);

            var selection = new List<object>(xceed.SelectedItems.Cast<object>().ToArray());

            IEnumerable<DataGridContext> childContexts = xceed.GetChildContexts();
            foreach (DataGridContext dataGridContext in childContexts)
                selection.AddRange(dataGridContext.SelectedItems);

            return selection.AsReadOnly();
        }