Example #1
0
        private void DataGridCopyingRowClipboardContent(object sender, DataGridRowClipboardEventArgs e)
        {
            DataGridClipboardCellContent content = new DataGridClipboardCellContent(
                e.Item, e.ClipboardRowContent[0].Column, ((FileSystemItem)e.Item).Name);

            e.ClipboardRowContent.Clear();
            e.ClipboardRowContent.Add(content);
        }
        /// <summary>
        /// gridCompounder_CopyingRowClipboardContent
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridCompounder_CopyingRowClipboardContent(object sender, DataGridRowClipboardEventArgs e)
        {
            int columnIndex = gridCompounder.CurrentCell.Column.DisplayIndex;
            var column      = gridCompounder.Columns[columnIndex];

            var companyName = ((ResultSetReinvestment)e.Item).Name;
            var cellContent = new DataGridClipboardCellContent(e.Item, column, companyName);

            e.ClipboardRowContent.Clear();
            e.ClipboardRowContent.Add(cellContent);
        }
        /// <summary>
        /// Field-by-field comparison to avoid reflection-based ValueType.Equals.
        /// </summary>
        /// <param name="obj">DataGridClipboardCellContent to compare.</param>
        /// <returns>True iff this and data are equal</returns>
        public override bool Equals(object obj)
        {
            if (!(obj is DataGridClipboardCellContent))
            {
                return(false);
            }

            DataGridClipboardCellContent clipboardCellContent = (DataGridClipboardCellContent)obj;

            return(_column == clipboardCellContent._column && _content == clipboardCellContent._content && _item == clipboardCellContent._item);
        }