private void resultStatusLookUpEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (e.Value == null) { e.DisplayText = string.Empty; } if (controlOperationsView.IsValidRowHandle(controlOperationsView.FocusedRowHandle)) { JointTestResult jointTestResult = controlOperationsView.GetRow(controlOperationsView.FocusedRowHandle) as JointTestResult; if (jointTestResult != null && jointTestResult.Operation != null) { availableResults.Clear(); if (jointTestResult.Operation.TestHasAccepted) { availableResults.Add(new EnumWrapper <JointTestResultStatus>(JointTestResultStatus.Accepted)); } if (jointTestResult.Operation.TestHasToRepair) { availableResults.Add(new EnumWrapper <JointTestResultStatus>(JointTestResultStatus.Repair)); } if (jointTestResult.Operation.TestHasToWithdraw) { availableResults.Add(new EnumWrapper <JointTestResultStatus>(JointTestResultStatus.Withdraw)); } resultStatusLookUpEdit.DataSource = availableResults; } } }
void SpinEditCustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if ((Decimal)e.Value == 0m) { return; } e.DisplayText = e.DisplayText.TrimEnd(new char[] { '0' }); return; SpinEdit spinEdit; if ((spinEdit = sender as SpinEdit) == null) { return; } var regex = new Regex("0+$"); var match = regex.Match(e.DisplayText); if (match.Success) { e.DisplayText = regex.Replace(e.DisplayText, string.Empty); } }
private void lkpSoLo_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (lkpSoLo.EditValue == null) { return; } }
private void secondJointElement_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { secondJointElement.Properties.Columns[0].Caption = Program.LanguageManager.GetString(StringResources.Joint_JointElement_Number); secondJointElement.Properties.Columns[1].Caption = Program.LanguageManager.GetString(StringResources.Joint_JointElement_Type); secondJointElement.Properties.Columns[2].Caption = Program.LanguageManager.GetString(StringResources.Joint_JointElement_Connectors); secondJointElement.Properties.Columns[3].Caption = Program.LanguageManager.GetString(StringResources.Joint_JointElement_Diameter); }
private void searchLookUpEdit1_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (null != e.Value) { e.DisplayText = this.shopName; } }
private void PKNumber_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (viewModel != null && viewModel.NumberKP == int.MinValue) { PKNumber.Text = ""; } }
private void textEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { string value = string.Empty; if (e.Value != null) { value = e.Value.ToString(); } else { value = "0"; } switch (value) { case "0": e.DisplayText = "InActive"; break; case "1": e.DisplayText = "Active"; break; case "2": e.DisplayText = "Archive"; break; default: e.DisplayText = "InActive"; break; } }
void Empty_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (string.IsNullOrEmpty(e.DisplayText)) { e.DisplayText = "None"; } }
private void HandleCustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (e.Value == null || (e.Value is int && (int)e.Value <= 0)) { e.DisplayText = GetCustomSearchEditorDisplayText(sender, null); } else { DataRow dr = null; if (e.Value is int) { if (((CTechCore.Tools.CustomControls.CustomSearchEditor)sender).Properties.DataSource == null) { return; } dr = ((DataView)((CTechCore.Tools.CustomControls.CustomSearchEditor)sender).Properties.DataSource).Table.Select($"{GetCustomSearchEditor(sender)} = {(int)e.Value} ").FirstOrDefault(); } else if (e.Value is DataRowView) { dr = ((DataRowView)e.Value).Row; } else if (e.Value is DataRow) { dr = (DataRow)e.Value; } else { } if (dr != null) { e.DisplayText = GetCustomSearchEditorDisplayText(sender, dr); } } }
public override string GetDisplayText(FormatInfo format, object editValue) { var displayText = string.Empty; var period = editValue as PeriodsSet; if (period != null) { displayText = period.ToString(format.FormatString, SeparatorChar); } else { var s = editValue as string; if (s != null) { displayText = PeriodsSet.Parse(s).ToString(format.FormatString, SeparatorChar); } } var e = new CustomDisplayTextEventArgs(editValue, displayText); if (format != EditFormat) { RaiseCustomDisplayText(e); } return(e.DisplayText); }
public static void SetCustomDisplayText(CustomDisplayTextEventArgs e) { if (string.IsNullOrEmpty(e.DisplayText) && e.Value != null && !string.IsNullOrEmpty(e.Value.ToString())) { e.DisplayText = e.Value.ToString(); } }
void checkedItem_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (!IsNoneValue(e.Value) || _enumDescriptor == null) { return; } e.DisplayText = _enumDescriptor.GetCaption(e.Value); }
private static void SetDisplayText(CustomDisplayTextEventArgs e, string displayText) { if (string.IsNullOrWhiteSpace(e.DisplayText)) { e.DisplayText = displayText; e.Handled = true; } }
private void checkedItem_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (EnumDescriptor == null) { return; } e.DisplayText = GetCaption((Enum)e.Value); }
private void RepositoryItemOnCustomDisplayText(object sender, CustomDisplayTextEventArgs e) { var typeInfo = XafTypesInfo.Instance.FindTypeInfo($"{e.Value}"); if (typeInfo != null) { e.DisplayText = CaptionHelper.GetClassCaption(typeInfo.FullName); } }
private void checkedComboBoxEdit1_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (m_listBoxVehicleModel == null) { e.DisplayText = "不限"; } else if (m_listBoxVehicleModel.Items[0].CheckState == CheckState.Checked) { e.DisplayText = "不限"; } }
private void inspectorsPopupContainerEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (e.Value == null) { e.DisplayText = string.Empty; } IList <Inspector> inspectors = e.Value as IList <Inspector>; e.DisplayText = viewModel.FormatInspectorList(inspectors); }
private void weldersPopupContainerEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (e.Value == null) { e.DisplayText = string.Empty; } IList <Welder> welders = e.Value as IList <Welder>; e.DisplayText = viewModel.FormatWelderList(welders); }
private void lookUpAuthor_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (e.Value == null) { return; } LibraryDataSet.AuthorRow authorRow = lds.Author.FindById((int)e.Value); if (authorRow == null) { return; } e.DisplayText = authorRow.FirstName + " " + authorRow.LastName; }
private void TypeTextEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (e == null || e.Value == null) { return; } try { e.DisplayText = EventTypeReference.GetEventReference((EventTypes)e.Value); }catch (Exception) { } }
private void colorPickEditMap_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { ColorPickEdit colorEdit = (sender as ColorPickEdit); if (colorEdit.Color.IsEmpty) { e.DisplayText = string.Empty; } else if (!colorEdit.Color.IsKnownColor) { Color color = colorEdit.Color; //X2 means 2 digit hex, so that F will be 0F e.DisplayText = String.Format("#{0:X2}{1:X2}{2:X2}", color.R, color.G, color.B); } }
private void HandleDisplayText(object sender, CustomDisplayTextEventArgs e) { if (e.Value == null) { } else { if (e.Value is DataRow) { e.DisplayText = ((DataRow)e.Value).Field <string>("Name"); } else { } } }
static void OnProgressBarCustomDisplayText(object sender, CustomDisplayTextEventArgs e) { try { if (e.Value == DBNull.Value || e.Value == null) { e.DisplayText = string.Empty; } else { e.DisplayText = ((double)e.Value).ToString("F2"); } } catch (Exception) { } }
/// <summary> /// Display list of selected items /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ComboControlCustomDisplayText(object sender, CustomDisplayTextEventArgs e) { string captionText = string.Empty; foreach (CheckedListBoxItemWrapper item in comboControl.Properties.Items) { if (item.CheckState == CheckState.Checked) { if (captionText.Length > 0) { captionText += ", "; } captionText += string.Format("{0}", item); } } e.DisplayText = captionText; }
private void repositoryItemTextEdit1_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { bool?gender = e.Value as bool?; if (gender == null) { e.DisplayText = "Herkes"; } else if (gender == true) { e.DisplayText = "Erkek"; } else if (gender == false) { e.DisplayText = "Kadın"; } }
private void resultStatusLookUpEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { JointTestResult jointTestResult = controlOperationsView.GetRow(controlOperationsView.FocusedRowHandle) as JointTestResult; if (e.Value != null) { JointTestResultStatus result; if (Enum.TryParse <JointTestResultStatus>(e.Value.ToString(), out result)) { e.DisplayText = (result == JointTestResultStatus.Undefined) ? "" : localizedResults[(int)result - 1]; } } else { e.DisplayText = string.Empty; } }
private void OnProgressBarCustomDisplayText(object sender, CustomDisplayTextEventArgs e) { try { if (e.Value == DBNull.Value || e.Value == null) { e.DisplayText = string.Empty; } else { //divide by 100 again to ensure that we show values formatted between 0 and 1 e.DisplayText = _doubleFormatter.Format(((double)e.Value) / 100); } } catch (Exception) { } }
private void searchLookUpEdit1_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (FunctionHelper.GetValue(e.Value).Contains(",")) { e.DisplayText = e.Value.ToString(); } else { var re = GetLuValues(); if (re[0].Count == 1) { e.DisplayText = re[1].First(); } else { e.DisplayText = ""; } } }
void TextEdit3CustomDisplayText(object sender, CustomDisplayTextEventArgs customDisplayTextEventArgs) { // https://documentation.devexpress.com/#WPF/CustomDocument11336 // https://documentation.devexpress.com/#WindowsForms/DevExpressXtraEditorsRepositoryRepositoryItem_CustomDisplayTexttopic if (customDisplayTextEventArgs.Value == null) { return; } var valueStr = customDisplayTextEventArgs.Value.ToString(); var regex = new Regex("(\\d{4})(\\d{4})(\\d{4})"); var match = regex.Match(valueStr); if (match.Success) { customDisplayTextEventArgs.DisplayText = regex.Replace(valueStr, "$1...$3"); } }
private void customDisplayText(object sender, CustomDisplayTextEventArgs e) { if (e.Value == null) { return; } try { e.DisplayText = Formatter.Format(e.Value.ConvertedTo <TPropertyType>()); } //it's ok to catch formatting exception here. Message will be displayed in the errorProvider catch (FormatException) { e.DisplayText = string.Empty; } catch (OverflowException) { _textBox.EditValue = LastValue; } }
void actionDropDown_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { var ykRow = gridView.GetFocusedDataRow(); e.DisplayText = GetActionName(ykRow.Field<MatchState>("MatchState"), (ImportAction)e.Value); }
void checkedItem_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (!IsNoneValue(e.Value) || _enumDescriptor == null) return; e.DisplayText = _enumDescriptor.GetCaption(e.Value); }
private void TypeTextEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (e == null || e.Value == null) return; try { e.DisplayText = EventTypeReference.GetEventReference((EventTypes) e.Value); }catch (Exception) { } }
private void weldersPopupContainerEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if(e.Value == null) e.DisplayText = string.Empty; IList<Welder> welders = e.Value as IList<Welder>; e.DisplayText = viewModel.FormatWelderList(welders); }
private void OnCustomDisplayText(Object sender, CustomDisplayTextEventArgs e) { e.DisplayText = ((Color)e.Value).ToHex(); }
private void PKNumber_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if (viewModel!=null && viewModel.NumberKP==int.MinValue) { PKNumber.Text = ""; } }
private void repositoryItemButtonEditAnswerOptions_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { e.DisplayText = "(AnswerOptionsCollection)"; }
private void ControlOperationLookUpEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { ControlOperationLookUpEdit.Columns[0].Caption = Program.LanguageManager.GetString(StringResources.Joint_OperationNameColumn); }
private void progressBarControl1_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { double v = Convert.ToDouble(e.Value); e.DisplayText = v.ToString("n0"); }
private void cboFollowUpTimeStart_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { e.DisplayText = Convert.ToDateTime(e.DisplayText).ToString("HH:mm"); }
private void inspectorsPopupContainerEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { if(e.Value == null) e.DisplayText = string.Empty; IList<Inspector> inspectors = e.Value as IList<Inspector>; e.DisplayText = viewModel.FormatInspectorList(inspectors); }
private void resultStatusLookUpEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { JointTestResult jointTestResult = controlOperationsView.GetRow(controlOperationsView.FocusedRowHandle) as JointTestResult; if(e.Value != null) { JointTestResultStatus result; if(Enum.TryParse<JointTestResultStatus>(e.Value.ToString(), out result)) { e.DisplayText = (result == JointTestResultStatus.Undefined) ? "" : localizedResults[(int)result - 1]; } } else { e.DisplayText = string.Empty; } }
/// <summary> /// Display list of selected items /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ComboControlCustomDisplayText(object sender, CustomDisplayTextEventArgs e) { string captionText = string.Empty; foreach (CheckedListBoxItem item in comboControl.Properties.Items) { if (item.CheckState == CheckState.Checked) { if (captionText.Length > 0) captionText += ", "; captionText += string.Format("{0}", item); } } e.DisplayText = captionText; }
private void personEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) { var person = e.Value as Person; if (person != null) e.DisplayText = person.FullName; }