protected virtual void OnColumnDisplayIndexChanged(DataGridColumnEventArgs e)
 {
     EventHandler<DataGridColumnEventArgs> handler = this.ColumnDisplayIndexChanged;
     if (handler != null)
     {
         handler(this, e);
     }
 }
        protected internal virtual void OnColumnReordered(DataGridColumnEventArgs e)
        {
            this.EnsureVerticalGridLines();

            EventHandler<DataGridColumnEventArgs> handler = this.ColumnReordered;
            if (handler != null)
            {
                handler(this, e);
            }
        }
 protected internal virtual new void OnColumnDisplayIndexChanged(DataGridColumnEventArgs e)
 {
 }
Ejemplo n.º 4
0
        internal void OnColumnDisplayIndexChanged(DataGridColumn dataGridColumn)
        {
            Debug.Assert(dataGridColumn != null);
            DataGridColumnEventArgs e = new DataGridColumnEventArgs(dataGridColumn);

            // Call protected method to raise event
            OnColumnDisplayIndexChanged(e);
        }
 protected internal virtual new void OnColumnReordered(DataGridColumnEventArgs e)
 {
 }
Ejemplo n.º 6
0
 protected internal virtual void OnColumnReordered(DataGridColumnEventArgs e)
 {
     if (ColumnReordered != null)
     {
         ColumnReordered(this, e);
     }
 }
Ejemplo n.º 7
0
        private void dgAggregate_ColumnReordered(object sender, DataGridColumnEventArgs e)
        {
            foreach (DataGridColumn column in this.dgAggregateSummary.Columns)
            {
                if (column.DisplayIndex == selectedReorderingColumnIndex)
                {
                    column.DisplayIndex = e.Column.DisplayIndex;
                    break;
                }
            }

            selectedReorderingColumnIndex = 0;
        }
        internal void OnColumnDisplayIndexChanged(DataGridColumn dataGridColumn)
        {
            Debug.Assert(dataGridColumn != null);
            DataGridColumnEventArgs e = new DataGridColumnEventArgs(dataGridColumn);

            // Call protected method to raise event
            if (dataGridColumn != this.ColumnsInternal.RowGroupSpacerColumn)
            {
                OnColumnDisplayIndexChanged(e);
            }
        }
Ejemplo n.º 9
0
 private void DataGrid_ColumnReordered(object sender, System.Windows.Controls.DataGridColumnEventArgs e)
 {
     _RecomputePrice();
     _RecomputePrice_Copy();
 }
        internal void OnMouseLeftButtonUp(ref bool handled, Point mousePosition)
        {
            this.IsPressed = false;

            if (_dragMode == DragMode.MouseDown)
            {
               OnMouseLeftButtonUp_Click(ref handled);
            }
            else if (_dragMode == DragMode.Reorder)
            {
                // Find header we're hovering over
                int? targetIndex = this.GetReorderingTargetDisplayIndex(mousePosition, true /* ignoreVertical */, true /* clipToVisible */);

                if (targetIndex.HasValue &&
                    ((!this.OwningColumn.IsFrozen && targetIndex.Value >= this.OwningGrid.FrozenColumnCount)
                      || (this.OwningColumn.IsFrozen && targetIndex.Value < this.OwningGrid.FrozenColumnCount)))
                {
                    this.OwningColumn.DisplayIndex = targetIndex.Value;

                    DataGridColumnEventArgs ea = new DataGridColumnEventArgs(this.OwningColumn);
                    this.OwningGrid.OnColumnReordered(ea);
                }

                DragCompletedEventArgs dragCompletedEventArgs = new DragCompletedEventArgs(mousePosition.X - _dragStart.Value.X, mousePosition.Y - _dragStart.Value.Y, false);
                this.OwningGrid.OnColumnHeaderDragCompleted(dragCompletedEventArgs);

                // If we autosized the indicator's height, set it back to NaN
                if (this._autoSizeDropLocationIndicatorHeight)
                {
                    this._autoSizeDropLocationIndicatorHeight = false;
                    this.OwningGrid.ColumnDropLocationIndicator.Height = double.NaN;
                }
            }
            else if (_dragMode == DragMode.Drag)
            {
                DragCompletedEventArgs dragCompletedEventArgs = new DragCompletedEventArgs(0, 0, false);
                this.OwningGrid.OnColumnHeaderDragCompleted(dragCompletedEventArgs);
            }

            SetDragCursor(mousePosition);

            // Variables that track drag mode states get reset in DataGridColumnHeader_LostMouseCapture
            ReleaseMouseCapture();
            DataGridColumnHeader._dragMode = DragMode.None;
            handled = true;
        }
Ejemplo n.º 11
0
 private void grid_ColumnDisplayIndexChanged(object sender, DataGridColumnEventArgs e)
 {
     SyncColumnsToServerDB();
 }
 void AutofilterDataGrid_ColumnReordered(object sender, DataGridColumnEventArgs e)
 {
     if (!string.IsNullOrEmpty(this.Name))
     {
         UpdateColumnConfigurationList(this.Name);
         this.ColumnsConfigurationController.Save();
     }
     else
     {
         throw new Exception("AutofilterDataGrid Name property should assign to include if column-config need to persist");
     }
 }
 protected internal virtual new void OnColumnReordered(DataGridColumnEventArgs e)
 {
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Called when data grid columns are reordered
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="DataGridColumnEventArgs"/> instance containing the event data.</param>
 private static void OnDataGridColumnReordered(object sender, DataGridColumnEventArgs e)
 {
     DataGrid dataGrid = (DataGrid)sender;
     UpdateColumnSettingsFromColumns(dataGrid);
 }
Ejemplo n.º 15
0
 private void cacheList_ColumnReordered(object sender, DataGridColumnEventArgs e)
 {
     _cacheListColumnInfoCollection.UpdateFromDataGrid(cacheList);
 }
Ejemplo n.º 16
0
 protected override void OnColumnReordered(DataGridColumnEventArgs e) {
   base.OnColumnReordered(e);
   this._owner._onColumnReordered(e);
 }
Ejemplo n.º 17
0
 private void cacheList_ColumnReordered(object sender, DataGridColumnEventArgs e)
 {
     StringBuilder sb = new StringBuilder();
     for (int i = 0; i < cacheList.Columns.Count; i++)
     {
         sb.AppendFormat("{0}|", cacheList.Columns[i].DisplayIndex);
     }
     PluginSettings.Instance.ColumnOrder = sb.ToString();
 }
 protected internal virtual new void OnColumnDisplayIndexChanged(DataGridColumnEventArgs e)
 {
 }
        private void fltdg_ColumnReordered(object sender, DataGridColumnEventArgs e)
        {
            foreach (DataGridColumn column in this.fltdgSummary.Columns)
            {
                if (column.DisplayIndex == selectedReorderingColumnIndex)
                {
                    column.DisplayIndex = e.Column.DisplayIndex;
                    break;
                }
            }

            ManageLastColumnMinWidth();

            selectedReorderingColumnIndex = 0;
        }
Ejemplo n.º 20
0
 /// <summary>
 ///     Called when the DisplayIndex of a column is modified.
 /// </summary>
 /// <remarks>
 ///     A column's DisplayIndex may be modified as the result of another column's DisplayIndex changing.  This is because the
 ///     DataGrid enforces that the DisplayIndex of all Columns are unique integers from 0 to Columns.Count -1.
 /// </remarks>
 protected internal virtual void OnColumnDisplayIndexChanged(DataGridColumnEventArgs e)
 {
     if (ColumnDisplayIndexChanged != null)
     {
         ColumnDisplayIndexChanged(this, e);
     }
 }
Ejemplo n.º 21
0
 protected override void OnColumnReordered(DataGridColumnEventArgs e) {
     UpdateColumnInfo();
     base.OnColumnReordered(e);
 }
        /// <summary> 
        ///     Method which completes the column header drag. Includes raising of events and changing column display index if needed.
        /// </summary> 
        private void FinishColumnHeaderDrag(bool isCancel) 
        {
            Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null"); 
            _prepareColumnHeaderDragging = false;
            _isColumnHeaderDragging = false;

            _draggingSrcColumnHeader.SuppressClickEvent = false; 

            if (_columnHeaderDragIndicator != null) 
            { 
                _columnHeaderDragIndicator.Visibility = Visibility.Collapsed;
                DataGridColumnFloatingHeader floatingHeader = _columnHeaderDragIndicator as DataGridColumnFloatingHeader; 
                if (floatingHeader != null)
                {
                    floatingHeader.ClearHeader();
                } 

                RemoveVisualChild(_columnHeaderDragIndicator); 
            } 

            if (_columnHeaderDropLocationIndicator != null) 
            {
                _columnHeaderDropLocationIndicator.Visibility = Visibility.Collapsed;
                DataGridColumnDropSeparator separator = _columnHeaderDropLocationIndicator as DataGridColumnDropSeparator;
                if (separator != null) 
                {
                    separator.ReferenceHeader = null; 
                } 

                RemoveVisualChild(_columnHeaderDropLocationIndicator); 
            }

            DragCompletedEventArgs dragCompletedEventArgs = new DragCompletedEventArgs(
                _columnHeaderDragCurrentPosition.X - _columnHeaderDragStartPosition.X, 
                _columnHeaderDragCurrentPosition.Y - _columnHeaderDragStartPosition.Y,
                isCancel); 
 
            ParentDataGrid.OnColumnHeaderDragCompleted(dragCompletedEventArgs);
            _draggingSrcColumnHeader.InvalidateArrange(); 

            if (!isCancel)
            {
                int newDisplayIndex = -1; 
                bool dragEndPositionValid = IsMousePositionValidForColumnDrag(
                    2.0, 
                    out newDisplayIndex); 

                DataGridColumn column = _draggingSrcColumnHeader.Column; 
                if (column != null && dragEndPositionValid && newDisplayIndex != column.DisplayIndex)
                {
                    column.DisplayIndex = newDisplayIndex;
 
                    DataGridColumnEventArgs columnEventArgs = new DataGridColumnEventArgs(_draggingSrcColumnHeader.Column);
                    ParentDataGrid.OnColumnReordered(columnEventArgs); 
                } 
            }
 
            _draggingSrcColumnHeader = null;
            _columnHeaderDragIndicator = null;
            _columnHeaderDropLocationIndicator = null;
        } 
Ejemplo n.º 23
0
 private void TweetColumns_ColumnReordered(object sender, DataGridColumnEventArgs e)
 {
     int displayIndex = e.Column.DisplayIndex;
       int oldIndex = this.viewModel.ColumnsToShow.IndexOf((e.Column.Header as TweetListView).DataContext as TweetListViewModel);
       if (displayIndex <= -1 || oldIndex <= -1)
     return;
       if (displayIndex < oldIndex)
       {
     for (int index = displayIndex; index <= oldIndex; ++index)
       ((Collection<TweetListViewModel>) this.viewModel.ColumnsToShow)[index].Index = index + 1;
       }
       if (displayIndex > oldIndex)
       {
     for (int index = oldIndex; index <= displayIndex; ++index)
       ((Collection<TweetListViewModel>) this.viewModel.ColumnsToShow)[index].Index = index - 1;
       }
       this.viewModel.ColumnsToShow.Move(oldIndex, displayIndex);
       ((Collection<TweetListViewModel>) this.viewModel.ColumnsToShow)[displayIndex].Index = displayIndex;
 }