checkbox 根据值选中

Posted oralig

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了checkbox 根据值选中相关的知识,希望对你有一定的参考价值。

#region 设置单选框选择的值
private void setCheckBoxValue(DataTable dt)
{
//选题内容评价
switch (dt.Rows[0]["xtnr"].ToString())
{
case "1":
xtnr1.Checked = true;
break;
case "2":
xtnr2.Checked = true;
break;
case "3":
xtnr3.Checked = true;
break;
case "4":
xtnr4.Checked = true;
break;
case "5":
xtnr5.Checked = true;
break;
default:
break;
}
//开题报告书面材料准备情况评价
switch (dt.Rows[0]["ktbg"].ToString())
{
case "1":
ktbg1.Checked = true;
break;
case "2":
ktbg2.Checked = true;
break;
case "3":
ktbg3.Checked = true;
break;
case "4":
ktbg4.Checked = true;
break;
case "5":
ktbg5.Checked = true;
break;
default:
break;
}
//文献查阅与资料总结评价
switch (dt.Rows[0]["wxcy"].ToString())
{
case "1":
wxcy1.Checked = true;
break;
case "2":
wxcy2.Checked = true;
break;
case "3":
wxcy3.Checked = true;
break;
case "4":
wxcy4.Checked = true;
break;
case "5":
wxcy5.Checked = true;
break;
default:
break;
}
//外文文献翻译情况评价
switch (dt.Rows[0]["wwwxfy"].ToString())
{
case "1":
wwwxfy1.Checked = true;
break;
case "2":
wwwxfy2.Checked = true;
break;
case "3":
wwwxfy3.Checked = true;
break;
case "4":
wwwxfy4.Checked = true;
break;
case "5":
wwwxfy5.Checked = true;
break;
default:
break;
}
//撰写计划执行情况评价
switch (dt.Rows[0]["planExec"].ToString())
{
case "1":
planExec1.Checked = true;
break;
case "2":
planExec2.Checked = true;
break;
case "3":
planExec3.Checked = true;
break;
case "4":
planExec4.Checked = true;
break;
case "5":
planExec5.Checked = true;
break;
default:
break;
}
//毕业实习(调查)报告完成情况评价
switch (dt.Rows[0]["sxFinish"].ToString())
{
case "1":
sxFinish1.Checked = true;
break;
case "2":
sxFinish2.Checked = true;
break;
case "3":
sxFinish3.Checked = true;
break;
case "4":
sxFinish4.Checked = true;
break;
case "5":
sxFinish5.Checked = true;
break;
default:
break;
}
//指导教师对阶段性工作质量评语评价
switch (dt.Rows[0]["workPY"].ToString())
{
case "1":
workPY1.Checked = true;
break;
case "2":
workPY2.Checked = true;
break;
case "3":
workPY3.Checked = true;
break;
case "4":
workPY4.Checked = true;
break;
case "5":
workPY5.Checked = true;
break;
default:
break;
}
//总体评价
switch (dt.Rows[0]["ztpj"].ToString())
{
case "1":
ztpj1.Checked = true;
break;
case "2":
ztpj2.Checked = true;
break;
case "3":
ztpj3.Checked = true;
break;
case "4":
ztpj4.Checked = true;
break;
case "5":
ztpj5.Checked = true;
break;
default:
break;
}
}
#endregion













































































































































































以上是关于checkbox 根据值选中的主要内容,如果未能解决你的问题,请参考以下文章

在js中怎样获得checkbox里选中的多个值?

checkbox 根据值选中

在js中怎样获得checkbox里选中的多个值?

js动态生成的checkbox取值和选中事件

php加载数据时怎么让Checkbox根据值自动选中

如何用js的函数控制checkbox是不是被选中