Example #1
0
        /// <summary>
        /// Adds the specific cell info into the <see cref="Syncfusion.UI.Xaml.Grid.GridSelectedCellsCollection"/> list.
        /// </summary>
        /// <param name="cellInfo">
        /// The cell info to add.
        /// </param>
        /// <exception cref="System.ArgumentException">Thrown when the cell info argument value is null.</exception>
        public void Add(GridCellInfo cellInfo)
        {
            if (cellInfo == null)
            {
                throw new ArgumentException("GridCellInfo can't be null in Add");
            }

            if (cellInfo.IsDataRowCell)
            {
                var selectedCellInfo = Find(cellInfo.RowData);
                if (selectedCellInfo != null)
                {
                    if (!selectedCellInfo.HasColumn(cellInfo.Column))
                    {
                        selectedCellInfo.ColumnCollection.Add(cellInfo.Column);
                    }
                }
                else
                {
                    selectedCellInfo = new GridSelectedCellsInfo()
                    {
                        RowData = cellInfo.RowData, NodeEntry = cellInfo.NodeEntry
                    };
                    if (cellInfo.Column != null)
                    {
                        selectedCellInfo.ColumnCollection.Add(cellInfo.Column);
                    }
                    internalCellsList.Add(selectedCellInfo);
                }
            }
            else if (cellInfo.IsUnBoundRow)
            {
                var selectedCellInfo = Find(cellInfo.GridUnboundRowInfo);
                if (selectedCellInfo != null)
                {
                    if (!selectedCellInfo.HasColumn(cellInfo.Column))
                    {
                        selectedCellInfo.ColumnCollection.Add(cellInfo.Column);
                    }
                }
                else
                {
                    selectedCellInfo = new GridSelectedCellsInfo()
                    {
                        GridUnboundRowInfo = cellInfo.GridUnboundRowInfo, RowIndex = cellInfo.RowIndex
                    };
                    if (cellInfo.Column != null)
                    {
                        selectedCellInfo.ColumnCollection.Add(cellInfo.Column);
                    }
                    internalCellsList.Add(selectedCellInfo);
                }
            }
            else
            {
                var selectedCellInfo = Find(cellInfo.RowIndex);
                if (selectedCellInfo == null)
                {
                    selectedCellInfo = new GridSelectedCellsInfo()
                    {
                        RowIndex = cellInfo.RowIndex, NodeEntry = cellInfo.NodeEntry, IsAddNewRow = cellInfo.IsAddNewRow, IsFilterRow = cellInfo.IsFilterRow
                    };
                    if (cellInfo.Column != null)
                    {
                        selectedCellInfo.ColumnCollection.Add(cellInfo.Column);
                    }
                    internalCellsList.Add(selectedCellInfo);
                }
            }
        }
Example #2
0
 /// <summary>
 /// Inserts a specified cell info into the <see cref="Syncfusion.UI.Xaml.Grid.GridSelectedCellsCollection"/> at the specified index.
 /// </summary>
 /// <param name="index">
 /// Zero-based index at which cell info should be inserted.
 /// </param>
 /// <param name="cellInfo">
 /// The cell info to insert.
 /// </param>
 public void Insert(int index, GridCellInfo cellInfo)
 {
     throw new NotImplementedException();
 }