问题描述
我有一个复选框列表,并在页面加载时将其与sqldatsource绑定.
我检查了dr ["DepartmentName"]的值.
我检查chkDepartments.Items.FindByText(dr["DepartmentName"].ToString());
但是,
尽管dr ["DepartmentName"]保留一个值,但发现chkDepartments.Items.FindByText(dr["DepartmentName"].ToString())
为空.
调试还表明,在此阶段,项目具有Datatextfield和datavaluefield作为system.data.datarow.
I have a checkboxlist and I bind it with sqldatsource on page load.
I check the value of dr["DepartmentName"].
I checkchkDepartments.Items.FindByText(dr["DepartmentName"].ToString());
However,chkDepartments.Items.FindByText(dr["DepartmentName"].ToString())
is found to be null although dr["DepartmentName"] holds a value.
Also debugging shows that at this stage items have Datatextfield and datavaluefield as system.data.datarow.
推荐答案
这篇关于我有一个复选框列表,我在页面加载时将它与sqldatsource绑定在一起......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!