vue for循环的数据 根据条件判断是否绑定事件
答案:2 悬赏:60
解决时间 2021-01-27 07:04
- 提问者网友:精神病院里
- 2021-01-26 16:57
vue for循环的数据 根据条件判断是否绑定事件
最佳答案
- 二级知识专家网友:長槍戰八方
- 2021-01-26 17:44
GV绑定数据后,写一个for循环. for (int i = 0; i <= GridView1.Rows.Count - 1; i++) { Label lbl = (Label)GridView1.Rows[i].FindControl("Label3"); if (lbl.Text == "-1") { lbl.Text = "未开通"; lbl.ForeColor = System.Drawing.Color.Red; } } 或者: for (int i = 0; i <= GridView1.Rows.Count - 1; i++) { if (GridView1.Rows[i].Cells[1].Text=="-1") { GridView1.Rows[i].Cells[1].Text = "未开通"; GridView1.Rows[i].Cells[1].ForeColor=System.Drawing.Color.Red; } }那你把这个for循环写进GridView_RowBound()事件里试试...还有,你确定你的是"label"么.而且label的ID是"Label3".
全部回答
- 1楼网友:神也偏爱
- 2021-01-26 18:41
为什么不在事件里面做判断呢?获取绑定的 isBoolean 的值,满足条件往下执行,不满足return false;
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯