怎么改变列表控件背景颜色?
目前标准版不支持改变列表控件背景颜色,需要专业版,在列表设计的后端代码编辑器进行代码设置。示例如下protected override void OnLoad(H3.SmartForm.LoadListViewResponse response){
base.OnLoad(response);
if(this.Request.ListScene==H3.SmartForm.ListScene.NormalList){
string isFormControl = this.Request["isFormControl"] == null ? "" : this.Request["isFormControl"].ToString();
//设置只在load列表数据时加载颜色
if(isFormControl != "1" && isFormControl != "true")
{
foreach(Dictionary < string, object > data in response.ReturnData)
{
//设置列名为Mobile的颜色为Red
data["F0000002"] = new H3.SmartForm.ListViewCustomCell(data["F0000002"] == null ? "--" : data["F0000002"].ToString(), H3.SmartForm.Color.Red);
}
}
}
}
效果图如下所示
我看到了楼主的代码,得到启发,写了一段根据不同状态改变颜色的代码。 钉小靖 发表于 2020-11-4 14:30
我看到了楼主的代码,得到启发,写了一段根据不同状态改变颜色的代码。
层主你好,列表后端代码这里好像用不了this.request.BizObjectId来取值和赋值,这里怎么获取列表里的参数,然后根据参数做对比给列表不同颜色?
页:
[1]