C# 除了绑定源中的一个列值外,如何修改list.IsModified?
目前,当我点击我的按钮时,我可以通过绑定源将某些文本和数字输出到我的文本框中。忽略索引计数器。这会告诉我在上面提到的文本框中实际需要哪个数据集行 问题是,对于.IsModified检查,我必须忽略数据库或bindingSource中的一列。在我的例子中,此列是“RPARAM4”。不要问为什么。但是如果你想知道。。。如果设置了某个条件,其中一个文本框将填充字母。这被识别为.IsModified to my list,它会触发一个“you real to leave not saving?”消息框,我希望避免出现这个消息框 我该怎么做 比如:C# 除了绑定源中的一个列值外,如何修改list.IsModified?,c#,list,visual-studio,winforms,bindingsource,C#,List,Visual Studio,Winforms,Bindingsource,目前,当我点击我的按钮时,我可以通过绑定源将某些文本和数字输出到我的文本框中。忽略索引计数器。这会告诉我在上面提到的文本框中实际需要哪个数据集行 问题是,对于.IsModified检查,我必须忽略数据库或bindingSource中的一列。在我的例子中,此列是“RPARAM4”。不要问为什么。但是如果你想知道。。。如果设置了某个条件,其中一个文本框将填充字母。这被识别为.IsModified to my list,它会触发一个“you real to leave not saving?”消息框,
if (listeGebuehren[indexCounter]).IsModified.Except(listeGebuehren[indexCounter].RPARAM4 = ignore;)
private void按钮leistungsnrplus\u单击(对象发送者,事件参数e)
{
checkBoxHoheitlicheGebuehr.Checked=false;
如果(textBoxCode3_2.Text==“H”)
{
checkBoxHoheitlicheGebuehr.Checked=true;
}
if(indexCounter>=0 | | indexCounter
能否提供listeGebuehren的相关代码?这是一张单子还是别的什么?如果要忽略一列,可以创建一个新的datatable,首先删除一列。然后,请尝试使用代码中的datatable。
private void buttonLeistungsNrPlus_Click(object sender, EventArgs e)
{
checkBoxHoheitlicheGebuehr.Checked = false;
if (textBoxCode3_2.Text == "H")
{
checkBoxHoheitlicheGebuehr.Checked = true;
}
if (indexCounter >= 0 || indexCounter < listeGebuehren.Count - 1)
{
if (listeGebuehren[indexCounter].IsModified)
{
DialogResult dialogResult = MessageBox.Show("Unsaved data. Do you really want to leave?", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
if (dialogResult == DialogResult.Yes)
{
indexCounter++;
bindingSourceLeistung.DataSource = listeGebuehren[indexCounter];
}
else if (dialogResult == DialogResult.No)
{
}
}
else {
indexCounter++;
loadData();
}
}
}