单据体设置列颜色:给力原创
金蝶云社区-云强_东
云强_东
72人赞赏了该文章 312次浏览 未经作者许可,禁止转载编辑于2024年09月23日 17:08:59


// 改变是否匹配列变色

private void SetDaBaoColor()

{

    EntryEntity entity = this.View.BusinessInfo.GetEntryEntity(单据体标识);

    List<Field> fields = entity.Fields;

    EntryGrid grid = this.View.GetControl<EntryGrid>(单据体标识);

    grid.Enabled = true;

    DynamicObjectCollection dyColls = this.Model.GetEntityDataObject(entity);//单据体实体


    var rowIndex = 0;

    dyColls.ToList().ForEach(item =>

    {

        if (!Convert.ToBoolean(item["字段名"]))

        {

            grid.SetBackcolor("字段名", "#B22222", rowIndex);

        }

        else

        {

            grid.SetBackcolor("字段名", "#228B22", rowIndex);

        }

        rowIndex++;

    });

    grid.SetSort("字段名", EntryGridFieldSortOrder.Ascending);//指定字段排序

}


赞 72