/// <summary> /// Xceed grid initializing insertion row handler. /// </summary> private void xceedGrid_InitializingInsertionRow(object sender, InitializingInsertionRowEventArgs e) { Cell cell = ((InsertionRow)e.InsertionRow).Cells["Name"]; cell.EditEnded -= cell_EditEnded; cell.EditEnded += new RoutedEventHandler(cell_EditEnded); }
/// <summary> /// Subscribe to cell property changed events. Doing so we will know when user change active cell. /// </summary> /// <param name="sender">Ignore.</param> /// <param name="e">Ignore.</param> private void _DataGridInitializingInsertionRow(object sender, InitializingInsertionRowEventArgs e) { DataRow row = _dataGrid.InsertionRow; foreach (var cell in row.Cells) { cell.PropertyChanged += new PropertyChangedEventHandler(_CellPropertyChanged); } }
/// <summary> /// Occurs insertion row initialized. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void XceedGrid_InitializingInsertionRow(object sender, InitializingInsertionRowEventArgs e) { e.InsertionRow.Cells[IS_CURRENT_COLUMN_CAPTION].Visibility = Visibility.Hidden; // NOTE: hide redundant check box }
/// <summary> /// Subscribe to cell property changed events. Doing so we will know when user change active cell. /// </summary> /// <param name="sender">Ignore.</param> /// <param name="e">Ignore.</param> private void _DataGridInitializingInsertionRow(object sender, InitializingInsertionRowEventArgs e) { DataRow row = _dataGrid.InsertionRow; foreach (var cell in row.Cells) cell.PropertyChanged += new PropertyChangedEventHandler(_CellPropertyChanged); }
/// <summary> /// Initializes insertion row. /// </summary> /// <param name="sender">Data grid control.</param> /// <param name="e">Event args.</param> private void _InitializingInsertionRow(object sender, InitializingInsertionRowEventArgs e) { // If insertion row was initialized before - remove handlers to avoid redundant calls. if (_insertionRow != null) { _insertionRow.EditBegun -= _InsertionRowEditBegun; _insertionRow.EditCanceled -= _InsertionRowEditCanceled; } _insertionRow = e.InsertionRow; // Remember default background of InsertionRow (VisualBrush with text "Click here..."). if (_insertionRowDefaultBackground == null) _insertionRowDefaultBackground = _insertionRow.Background; // Subscribe to events to set valid background for InsertoinRow. _insertionRow.EditBegun += new RoutedEventHandler(_InsertionRowEditBegun); _insertionRow.EditCanceled += new RoutedEventHandler(_InsertionRowEditCanceled); }