void DataControl_CurrentItemChanged(object sender, DevExpress.Xpf.Grid.CurrentItemChangedEventArgs e) { GLTransTypeGridClient oldselectedItem = e.OldItem as GLTransTypeGridClient; if (oldselectedItem != null) { oldselectedItem.PropertyChanged -= GLTransTypeGridClient_PropertyChanged; } GLTransTypeGridClient selectedItem = e.NewItem as GLTransTypeGridClient; if (selectedItem != null) { selectedItem.PropertyChanged += GLTransTypeGridClient_PropertyChanged; if (selectedItem.accntSource == null) { SetAccountSource(selectedItem); } if (selectedItem.offsetAccntSource == null) { SetOffsetAccountSource(selectedItem); } } }
private void SetOffsetAccountSource(GLTransTypeGridClient rec) { SQLCache cache; switch (rec._OffsetAccountType) { case GLJournalAccountType.Finans: cache = LedgerCache; break; case GLJournalAccountType.Debtor: cache = DebtorCache; break; case GLJournalAccountType.Creditor: cache = CreditorCache; break; default: return; } if (cache != null) { int ver = cache.version + 10000 * ((int)rec._OffsetAccountType + 1); if (ver != rec.OffsetAccountVersion || rec.offsetAccntSource == null) { rec.OffsetAccountVersion = ver; rec.offsetAccntSource = cache; rec.NotifyPropertyChanged("OffsetAccountSource"); } } }
private void OffsetAccount_GotFocus(object sender, RoutedEventArgs e) { GLTransTypeGridClient selectedItem = dgGLTrans.SelectedItem as GLTransTypeGridClient; if (selectedItem != null) { SetOffsetAccountSource(selectedItem); if (prevOffsetAccount != null) { prevOffsetAccount.isValidate = false; } var editor = (CorasauGridLookupEditorClient)sender; prevOffsetAccount = editor; editor.isValidate = true; } }
private void localMenu_OnItemClicked(string ActionType) { GLTransTypeGridClient selectedItem = dgGLTrans.SelectedItem as GLTransTypeGridClient; switch (ActionType) { case "AddRow": dgGLTrans.AddRow(); break; case "SaveGrid": SaveData(); break; case "DeleteRow": dgGLTrans.DeleteRow(); break; default: gridRibbon_BaseActions(ActionType); break; } }