Exemplo n.º 1
0
 /// <summary>
 /// Dinh dang field
 /// </summary>
 /// <param name="grid"></param>
 /// <param name="fieldName"></param>
 /// <param name="formatType"></param>
 /// <param name="formatString"></param>
 public static void FormatDataField(GridView grid, string fieldName, DevExpress.Utils.FormatType formatType, string formatString)
 {
     if (formatType == DevExpress.Utils.FormatType.Custom)
     {
         grid.Columns[fieldName].DisplayFormat.Format = new BaseFormatter();
     }
     grid.Columns[fieldName].DisplayFormat.FormatString = formatString;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Dinh dang nhieu field
 /// </summary>
 /// <param name="grid"></param>
 /// <param name="fieldName"></param>
 /// <param name="formatType"></param>
 /// <param name="formatString"></param>
 public static void FormatDataField(GridView grid, string[] fieldNames, DevExpress.Utils.FormatType formatType, string formatString)
 {
     for (int i = 0; i < fieldNames.Length; i++)
     {
         if (formatType == DevExpress.Utils.FormatType.Custom)
         {
             grid.Columns[fieldNames[i]].DisplayFormat.Format = new BaseFormatter();
         }
         grid.Columns[fieldNames[i]].DisplayFormat.FormatString = formatString;
     }
 }
Exemplo n.º 3
0
 public void setGrid(DevExpress.XtraGrid.Columns.GridColumn col, DevExpress.Utils.FormatType ftype = DevExpress.Utils.FormatType.None, string format = "")
 {
     gridView1.Columns.Add(col);
     col.DisplayFormat.FormatType   = ftype;
     col.DisplayFormat.FormatString = format;
 }