本文介绍了单元验证和数据表行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个搜索例程我从GRIDVIEW_CellValidating呼叫, this.dtMoulds.Rows [0]不包含正确的信息.
I have a search routine that I call from GRIDVIEW_CellValidating, the this.dtMoulds.Rows[0] does not contain the correct information.
有人可以帮我解决这个问题吗?
Can anyone help me correct this?
if (this.MOULD_search(strItem ))
{
int cellRow = (((System.Windows.Forms.DataGridView)(sender)).CurrentRow.Index);//get the current cell
this.dgvitems.Rows[cellRow].Cells["Column2"].Value = this.dtMoulds.Rows[0 ]["E_DESCRIPTION"].ToString();
this.dgvitems.Rows[cellRow].Cells["Column4"].Value = this.dtMoulds.Rows[0]["E_MAXRUN"].ToString();
this.dgvitems.Rows[cellRow].Cells["Column5"].Value = this.dtMoulds.Rows[0]["E_RATEPERDAY"].ToString();
this.dgvitems.Rows[cellRow].Cells["Column6"].Value = this.dtMoulds.Rows[0]["E_LINE"].ToString();
this.dgvitems.Rows[cellRow].Cells["Column7"].Value = this.dtMoulds.Rows[0]["E_UNITOFMEASURE"].ToString();
}
else
{
e.Cancel = true;
}
推荐答案
能否请您尝试使用字符串 strSearch = " E_SUBITEMNUMBER =" + strCode  ;;
Can you please try using string strSearch = "E_SUBITEMNUMBER=" + strCode ;
谢谢
这篇关于单元验证和数据表行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!