MakeGridHeader 设置背景色前景色失败

发布于 2020-08-29 11:57:13

不管是背景色还是前景色 按照网站上的指示都无效
public override string SetFullRowColor(object entity)

    {
        return "FF0000";
    }
    

protected override IEnumerable<IGridColumn<RecordValue1_View>> InitGridHeader()

    {
        return new List<GridColumn<RecordValue1_View>>{
            this.MakeGridHeader(x => x.modename_view).SetWidth(100),
            this.MakeGridHeader(x => x.typegroupname_view).SetWidth(100),
            this.MakeGridHeader(x => x.value).SetEditType(EditTypeEnum.TextBox,null).SetWidth(100).SetBackGroundFunc((entity)=> {
                if (entity.value < entity.llimit || entity.value > entity.hlimit)
        {
            return "008000";
        }
        else if (entity.value <= entity.hlimit &&entity.value >= entity.llimit)
        {
            return "FFC90E";
        }
        else
        {
            return "FF0000";
        } }),
            this.MakeGridHeader(x => x.TypegroupDesc).SetWidth(100).SetForeGroundFunc((entity)=> "ff0000"),
            this.MakeGridHeader(x => x.typeEnumvalue).SetWidth(100).SetEditType(EditTypeEnum.ComboBox,AlltypeValues).SetBackGroundFunc((entity)=>{
                          if (entity.typeEnumvalue == entity.typeEnumvalue)
        {
            return "008000";
        }
        else if (entity.typeEnumvalue != entity.typeEnumvalue)
        {
            return "FFC90E";
        }
        else
        {
            return "FF0000";
        } }),
                
            this.MakeGridHeader(x => x.hlimit).SetWidth(100),
            this.MakeGridHeader(x => x.llimit).SetWidth(100),
            this.MakeGridHeader(x => x.hlimit1).SetWidth(100),
            this.MakeGridHeader(x => x.llimit1).SetWidth(100),
            this.MakeGridHeader(x => x.valuedesc_view).SetWidth(100),
            //this.MakeGridHeaderAction(width: 200)
        };
    }

查看更多

关注者
0
被浏览
181
1 个回答
hailang
hailang 2020-08-29

@liuliang_wtm 我找到原因是因为我设置了DetailGridPrix,颜色就失效了
//public RecordValue1ListVM()

    //{
    //    DetailGridPrix = "RecordValues";
    //}

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览