private void repositoryItemComboBox1_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { if (e.Value != null) { switch (e.Value.ToString()) { case "0": e.DisplayText = "已上报"; break; case "1": e.DisplayText = "待上报/补传待上报"; break; case "2": e.DisplayText = "已修改未上报"; break; default: break; } } }
private void gridLookUpEditBatch_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { var editor = sender as GridLookUpEdit; var view = editor.Properties.View; var selectedRowsCount = view.GetSelectedRows().Count(); List <string> values = new List <string>(); foreach (int rowHandle in view.GetSelectedRows()) { values.Add(view.GetRowCellValue(rowHandle, "BatchNo").ToString()); } if (selectedRowsCount > 0) { e.DisplayText = string.Join(",", values); } }
private void editAction_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { if (e.Value == null) { return; } if ((string)e.Value == "True") { e.DisplayText = "Allowed"; } else { e.DisplayText = "Blocked"; } }
void MyGridLookUpEdit_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { StringBuilder sb = new StringBuilder(); PropertyDescriptorCollection collection = ListBindingHelper.GetListItemProperties(Properties.GridSelection.Selection); PropertyDescriptor desc = collection[Properties.DisplayMember]; foreach (object rv in Properties.GridSelection.Selection) { if (sb.ToString().Length > 0) { sb.Append(", "); } sb.Append(desc.GetValue(rv).ToString()); } e.DisplayText = sb.ToString(); }
static private void LookUpEdit_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { DevExpress.XtraEditors.LookUpEdit le = (DevExpress.XtraEditors.LookUpEdit)sender; if (!le.Properties.ValueMember.Equals(le.Properties.DisplayMember)) { object v1 = e.Value; object v2 = e.DisplayText; if (v1 != null && v2 != null) { if (!(v1 is string) || ISM.Lib.Static.ToStr(v1) != "") { e.DisplayText = string.Format("{0} - {1}", v1, v2); } } } }
private void UiLista_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { var lista = sender as SearchLookUpEdit; if (lista == null) { return; } var vista = lista.Properties.View; if (string.IsNullOrEmpty(((ObjetoParaGuardarEnVista)vista.Tag).NombreDelControlDeLista)) { return; } e.DisplayText = ObtenerTextoAMostrarEnLaLista(((ObjetoParaGuardarEnVista)vista.Tag).ListaDeCamposAMostrar, vista); }
private void hyperLinkEdit1_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { if (hyperLinkEdit1.EditValue != null) { if (!string.IsNullOrEmpty(hyperLinkEdit1.EditValue.ToString())) { NetworkFileSystemUtilsProxy p = new NetworkFileSystemUtilsProxy(); FileInfo i = p.CretateUncFileFinfo(hyperLinkEdit1.EditValue.ToString()); if (i != null) { e.DisplayText = i.Name; } } } }
private void barPasswordStrength_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { try { switch ((int)e.Value) { case 0: e.DisplayText = "Blank"; break; case 1: case 2: e.DisplayText = "Very Weak"; break; case 3: case 4: e.DisplayText = "Weak"; break; case 5: case 6: e.DisplayText = "Medium"; break; case 7: case 8: e.DisplayText = "Strong"; break; case 9: case 10: e.DisplayText = "Very Strong"; break; } } catch (Exception ex) { if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }
private void TextEdit3_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { if (e.Value == null) { return; } else if (e.Value.ToString() == "1") { e.DisplayText = "占用"; } else if (e.Value.ToString() == "9") { e.DisplayText = "空闲"; } else if (e.Value.ToString() == "0") { e.DisplayText = "未用"; } }
private void cbePermission_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { if (e.Value == null) { return; } switch (e.Value.ToString()) { case "0": e.DisplayText = Program.infoResource.GetLocalizedString(language.InfoId.Manager); return; case "1": e.DisplayText = Program.infoResource.GetLocalizedString(language.InfoId.Operator); return; case "2": e.DisplayText = Program.infoResource.GetLocalizedString(language.InfoId.Tourist); return; } }
public override string GetDisplayText(DevExpress.Utils.FormatInfo format, object editValue) { string displayText = string.Empty; if (this.IsBoundMode) { displayText = this.GetDisplayText(editValue, true); } else { displayText = this.GetDisplayText(editValue, false); } DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e = new DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs(editValue, base.GetDisplayText(format, editValue)); if (format != this.EditFormat) { this.RaiseCustomDisplayText(e); } return(displayText); }
private void txtPhong_Properties_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { if (dtPhong.Rows.Count == 0) { windowsUIButtonPanel1.Buttons[0].Properties.Visible = false; txtPhong.ErrorText = "Không có phòng trống"; return; } var editor = sender as GridLookUpEdit; var view = editor.Properties.View; var selectedRowsCount = view.GetSelectedRows().Count(); e.DisplayText = ""; if (selectedPhong.Count == 0) { windowsUIButtonPanel1.Buttons[0].Properties.Visible = false; txtPhong.ErrorText = "Không có phòng nào được chọn"; return; } else { windowsUIButtonPanel1.Buttons[0].Properties.Visible = true; txtPhong.ErrorText = ""; } for (int i = 0; i < selectedPhong.Values.Count; i++) { e.DisplayText += selectedPhong.Values.ToList()[i].TenPhong; if (i != selectedPhong.Values.Count - 1) { e.DisplayText += "; "; } } }
void SpinEditCustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { if ((Decimal)e.Value == 0m) { 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 LookUpEdit_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { try { string displayText = string.Empty; foreach (int index in gridLookUpEdit1View.GetSelectedRows()) { DataRow drSelected = dsMain.Rows[index]; if (string.IsNullOrEmpty(displayText)) { displayText = drSelected["SOrderNo"].ToString(); } else { displayText = displayText + " , " + drSelected["SOrderNo"].ToString(); } } e.DisplayText = displayText; } catch (Exception ex) { } }
private void slueTest_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { SearchLookUpEdit searchLookUpEdit = sender as SearchLookUpEdit; var view = searchLookUpEdit.Properties.View; int[] selectedRows = view.GetSelectedRows(); if (selectedRows.Length > 0) { string sValues = ""; for (int iRow = 0; iRow < selectedRows.Length; iRow++) { if (iRow == 0) { sValues = view.GetRowCellValue(selectedRows[iRow], "BIG_CLASS_DESC").ToString(); } else { sValues += "," + view.GetRowCellValue(selectedRows[iRow], "BIG_CLASS_DESC").ToString(); } } e.DisplayText = sValues; } }
void cboGridSucursales_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { StringBuilder sb = new StringBuilder(); GridCheckMarksSelection gridCheckMark = sender is GridLookUpEdit ? (sender as GridLookUpEdit).Properties.Tag as GridCheckMarksSelection : (sender as RepositoryItemGridLookUpEdit).Tag as GridCheckMarksSelection; if (gridCheckMark == null) { return; } foreach (DataRowView rv in gridCheckMark.Selection) { if (sb.ToString().Length > 0) { sb.Append(", "); } sb.AppendFormat("{0}; {1}", rv["SucursalesId"], rv["SucursalesNombre"]); } e.DisplayText = sb.ToString(); if (sb.ToString() == string.Empty) { e.DisplayText = "-Seleccione-"; } }
private void treeListLookUpLoaiTS_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { try { if (isCheck) { String str = ""; List <LoaiTaiSan> list = getListLoaiTS(); foreach (LoaiTaiSan loaiTS in list) { str += loaiTS.ten + ", "; } if (str.Length > 2) { str = str.Substring(0, str.Length - 2); } e.DisplayText = str; } } catch (Exception ex) { Debug.WriteLine(this.Name + "->treeListLookUpLoaiTS_CustomDisplayText: " + ex.Message); } }
private void txtTienPhat_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { if (txtTienPhat.Properties.ReadOnly) { return; } if (check) { if (txtTienPhat.Text.Length > 0) { try { int tien = int.Parse(txtTienPhat.EditValue.ToString()); txtTienPhat.Text = string.Format("{0:0,0 vnđ}", tien); } catch (Exception) { return; throw; } } } }
private void UiListaClientes_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { e.DisplayText = ObtenerTextoAMostrarListaClientes(); }
void rich_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { //e.DisplayText = text; }
private void RepositoryItemPopupContainerEdit1_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { e.DisplayText = ((DataStorage)e.Value).ToDisplayText(); }
private void shProgressBar_Timeout_Properties_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { int sophut = (e.Value.To <int>() / 60); int soGiay = e.Value.To <int>() - sophut * 60; e.DisplayText = string.Format("Còn lại {0}:{1}", sophut, soGiay); }
private void cbePermission_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { }
void comboBoxEdit1_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { e.DisplayText = ((CultureInfo)e.Value).DisplayName; }
//下拉框关闭修改文本框的值 private void treeDept_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { e.DisplayText = keyName; }
private void dateEdit1_Properties_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { //if (dedUpdStatusDate.DateTime == DateTime.MinValue) // e.DisplayText = ""; }
private void lUp_numberForm_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { e.DisplayText = e.DisplayText + " " + e.Value; }
private void UiSearchLookUpBodegas_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { e.DisplayText = Bodegas == null ? string.Empty : string.Join(",", Bodegas.Where(b => b.IS_SELECTED).Select(b => b.NAME)); }
private void lkpCustomerGrp_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { }
private void popupContainerEdit1_Properties_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { }