private void OnCellValueChanging(object sender, TreeListCellValueChangedEventArgs e) { if (e.Column.FieldName.Equals("IsActive")) { listView.CommitEditing(); } }
void CellValueChanging(object sender, TreeListCellValueChangedEventArgs e) { if (e.Column.FieldName == StartDateFieldName || e.Column.FieldName == EndDateFieldName || e.Column.FieldName == StateFieldName) { view.CommitEditing(true); } }
public void VerifySaveCellValueOnCellValueChanged() { var eventArgs = new TreeListCellValueChangedEventArgs(new TreeListNode(this.domainRow), this.gridColumn, "updated", "test") { RoutedEvent = TreeListView.CellValueChangedEvent }; this.treelistControl.View.RaiseEvent(eventArgs); this.session.Verify(x => x.Write(It.IsAny <OperationContainer>())); }
private void OnCellValueChanged(object sender, TreeListCellValueChangedEventArgs e) { if (e.Row != null) { String name = e.Value != null?e.Value.ToString().Trim() : ""; String oldName = e.OldValue != null?e.OldValue.ToString().Trim() : ""; Domain.Attribute attribute = (Domain.Attribute)e.Row; if (!ValidateName(attribute, name)) { attribute.name = oldName; e.Handled = true; return; } if (!name.Equals(oldName.Trim())) { if (attribute.IsDefault) { attribute.name = oldName; Domain.Attribute newAttribute = new Domain.Attribute(); newAttribute.name = name; newAttribute.parent = this.Root; ForgetDefaultAttributes(this.Root); this.Root.AddChild(newAttribute); AddDefaultAttributes(this.Root); int row = Source.Count; if (row > 0) { Source.Insert(row - 1, newAttribute); } else { Source.Add(newAttribute); } SetSelectedValue(newAttribute); } else { attribute.name = name; ForgetDefaultAttributes(attribute.parent); attribute.parent.UpdateChild(attribute); AddDefaultAttributes(attribute.parent); SetSelectedValue(attribute); } if (Changed != null) { Changed(); } } } }
public override void TreelistExistingRowAddUndoAndSave(TreeListCellValueChangedEventArgs e) { base.TreelistExistingRowAddUndoAndSave(e); if (e.Column.FieldName == BindableBase.GetPropertyName(() => new COMMODITY_CODE().CODE)) { EntitiesUndoRedoManager.RewindActionId(1); EntitiesUndoRedoManager.PauseActionId(); COMMODITY_CODE editedCOMMODITY_CODE = (COMMODITY_CODE)e.Row; AddUndoOnFULLCODEChanges(editedCOMMODITY_CODE); RecurseRenameChildrenFULLCODE(editedCOMMODITY_CODE.GUID); IEnumerable <COMMODITY_CODE> childrenCOMMODITY_CODES = RecurseFindChildren(editedCOMMODITY_CODE, this.Entities); BulkSave(childrenCOMMODITY_CODES); } }
/// <summary> /// Persist the new value of the cell. /// </summary> /// <param name="sender"> /// The Grid view that is being edited. /// </param> /// <param name="e"> /// The cell value changed event. /// </param> private void SaveCellValue(object sender, TreeListCellValueChangedEventArgs e) { try { var row = e.Row as IRowViewModelBase <Thing>; if (row == null) { return; } row.CreateCloneAndWrite(e.Value, e.Column.FieldName); } catch (Exception exception) { Logger.Error(exception, "A problem occurend when executing SaveCellValue"); } }
void TreeListView_OnCellValueChanging(object sender, TreeListCellValueChangedEventArgs e) { if (e.Column.FieldName != "UseForAddReference") { return; } TreeListView list = (TreeListView)sender; e.Node.ExpandAll(); bool isChecked = (bool)e.Value; TreeListNodeIterator iterator = new TreeListNodeIterator(e.Node); foreach (var node in iterator) { NavigateTreeItem item = (NavigateTreeItem)node.Content; item.UseForAddReference = isChecked; } }
private void OnCategoryChanged(object sender, TreeListCellValueChangedEventArgs e) { if (!e.Column.FieldName.Equals("Category") || e.OldValue == e.Value) { return; } var expenses = DataContext as ExpensesViewModel; var currentTransaction = expenses?.TransactionsView.CurrentItem as TransactionViewModel; if (currentTransaction == null) { return; } expenses.CategoriesMap.AddSupplierToCategory(currentTransaction.SupplierId, (Guid)e.Value); }