/// <summary>
 /// 添加Error列,主要为批量模式使用
 /// </summary>
 public void AddErrorColumn()
 {
     //寻找所有Header为错误信息的列,如果没有则添加
     if (GridHeaders.Where(x => x.Title == "错误").FirstOrDefault() == null)
     {
         var temp = GridHeaders as List <GridColumn <TModel> >;
         if (temp.Where(x => x.ColumnType == GridColumnTypeEnum.Action).FirstOrDefault() == null)
         {
             temp.Add(this.MakeGridColumn(x => x.BatchError, Width: 200, Header: "错误").SetForeGroundFunc(x => "ff0000"));
         }
         else
         {
             temp.Insert(temp.Count - 1, this.MakeGridColumn(x => x.BatchError, Width: 200, Header: "错误").SetForeGroundFunc(x => "ff0000"));
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 添加Error列,主要为批量模式使用
 /// </summary>
 public void AddErrorColumn()
 {
     GetHeaders();
     //寻找所有Header为错误信息的列,如果没有则添加
     if (GridHeaders.Where(x => x.Field == "BatchError").FirstOrDefault() == null)
     {
         var temp = GridHeaders as List <GridColumn <TModel> >;
         if (temp.Where(x => x.ColumnType == GridColumnTypeEnum.Action).FirstOrDefault() == null)
         {
             temp.Add(this.MakeGridColumn(x => x.BatchError, Width: 200, Header: Core.CoreProgram.Callerlocalizer["Error"]).SetForeGroundFunc(x => "ff0000"));
         }
         else
         {
             temp.Insert(temp.Count - 1, this.MakeGridColumn(x => x.BatchError, Width: 200, Header: Core.CoreProgram.Callerlocalizer["Error"]).SetForeGroundFunc(x => "ff0000"));
         }
     }
 }