private void ppCustomer_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
 {
     if (e.Value == null || (e.Value is int && (int)e.Value <= 0))
     {
         e.DisplayText = "Select Customer";
     }
     else
     {
         if (e.Value is int)
         {
             if (((CTechCore.Tools.CustomControls.CustomSearchEditor)sender).Properties.DataSource == null)
             {
                 return;
             }
             DataRow dr = ((DataView)((CTechCore.Tools.CustomControls.CustomSearchEditor)sender).Properties.DataSource).Table.Select($"ClientID = {(int)e.Value} ").FirstOrDefault();
             e.DisplayText = $"{dr.Field<string>("Account")}: {dr.Field<string>("Name")}";
         }
         else if (e.Value is DataRowView)
         {
             DataRow dr = ((DataRowView)e.Value).Row;
             e.DisplayText = $"{dr.Field<string>("Account")}: {dr.Field<string>("Name")}";
         }
         else if (e.Value is DataRow)
         {
             DataRow dr = (DataRow)e.Value;
             e.DisplayText = $"{dr.Field<string>("Account")}: {dr.Field<string>("Name")}";
         }
         else
         {
         }
     }
 }
Exemple #2
0
 private void spiHocPhi_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
 {
     if (!(e.Value is DBNull))
     {
         decimal     price = Convert.ToDecimal(e.Value);
         CultureInfo CiVNI = new CultureInfo("vi-VN", false);
         e.DisplayText = string.Format(CiVNI, "{0:c0}", price);
     }
 }
Exemple #3
0
        private void UiListaDeCliente_Properties_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
        {
            StringBuilder cadena = new StringBuilder();

            foreach (var cliente in UiListaDeCliente.Properties.View.GetSelectedRows().Select(indice => (Cliente)UiListaDeCliente.Properties.View.GetRow(indice)))
            {
                if (cadena.Length > 0)
                {
                    cadena.Append(",");
                }
                cadena.Append(cliente.CLIENT_CODE);
            }
            e.DisplayText = cadena.ToString();
        }
Exemple #4
0
        private void hyperLinkEdit1_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
        {
            if (hyperLinkEdit1.EditValue != null)
            {
                if (!string.IsNullOrEmpty(hyperLinkEdit1.EditValue.ToString()))
                {
                    DirectoryInfo i = new DirectoryInfo(hyperLinkEdit1.EditValue.ToString());

                    if (i.Exists)
                    {
                        e.DisplayText = i.Name;
                    }
                    else
                    {
                        hyperLinkEdit1.EditValue = null;
                    }
                }
            }
        }
Exemple #5
0
 private void Repository_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
 {
     if (showEmptyColDisplayText)
     {
         if (sender == deDate)
         {
             if (string.IsNullOrEmpty(e.DisplayText))
             {
                 e.DisplayText = "<Datum wählen>";
             }
         }
         else if (sender == leGenders)
         {
             if (string.IsNullOrEmpty(e.DisplayText))
             {
                 e.DisplayText = "<Geschlecht wählen>";
             }
         }
         else if (sender == leCities)
         {
             if (string.IsNullOrEmpty(e.DisplayText))
             {
                 e.DisplayText = "<Stadt wählen>";
             }
         }
         else if (sender == leClasses)
         {
             if (string.IsNullOrEmpty(e.DisplayText))
             {
                 e.DisplayText = "<Klasse wählen>";
             }
         }
         else if (sender == ccbeFunctions)
         {
             if (string.IsNullOrEmpty(e.DisplayText))
             {
                 e.DisplayText = "<Funktion(en) wählen>";
             }
         }
     }
 }
Exemple #6
0
        /// <summary>
        /// searchLookUpEdit_CustomDisplayText
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void searchLookUpEdit_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
        {
            SearchLookUpEdit searchLookUpEdit = (SearchLookUpEdit)sender;
            String           displayMember    = searchLookUpEdit.Properties.DisplayMember;
            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], displayMember).ToString();
                    }
                    else
                    {
                        sValues += "," + view.GetRowCellValue(selectedRows[iRow], displayMember).ToString();
                    }
                }
                e.DisplayText = sValues;
            }
        }
 private void customSearchEditor1_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
 {
 }
Exemple #8
0
 private void UiLookUpEditZonasAAsignar_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
 {
     e.DisplayText = ObtenerTextoAMostrarZonaAAsociar();
 }