本文介绍了我有一个复选框列表,我在页面加载时将它与sqldatsource绑定在一起......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个复选框列表,并在页面加载时将其与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 check
chkDepartments.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绑定在一起......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 22:37