private void AddFileFlagButton_Click(object sender, EventArgs e) { try { //bool flagCodeExists = FileFlagGridEX.Find(FileFlagGridEX.RootTable.Columns[3], Janus.Windows.GridEX.ConditionOperator.Equal, FlagCodeMultiDropDown.SelectedValue, 0, 1); int rowNum = FileFlagBindingSource.Find("FlagCode", FlagCodeMultiDropDown.SelectedValue); if (rowNum < 0) { atriumDB.FileFlagRow ffr; // add new appeal grounds ffr = (atriumDB.FileFlagRow)FM.GetFileFlag().Add(FM.CurrentFile); ffr.FileId = FM.CurrentFileId; ffr.FlagCode = FlagCodeMultiDropDown.SelectedValue.ToString(); ffr.EndEdit(); //FileFlagBindingSource.EndEdit(); //FileFlagGridEX.Refresh(); Save(); FileForm().DisplayFileFlag(); //FM. //OnValidated(new EventArgs()); } else { FileFlagGridEX.MoveToRowIndex(rowNum); } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void FileFlagGridEX_ColumnButtonClick(object sender, Janus.Windows.GridEX.ColumnActionEventArgs e) { try { if (CurrentFileFlagRow() == null) { return; } if (e.Column.Key.ToUpper() == "DELETE") // verify which column button was clicked { if (FM.GetFileFlag().CanDelete(CurrentFileFlagRow())) { if (UIHelper.ConfirmDelete()) { CurrentFileFlagRow().Delete(); FileFlagBindingSource.EndEdit(); Save(); FileForm().DisplayFileFlag(); } } } } catch (Exception x) { UIHelper.HandleUIException(x); } }