开发者

how to determine datagridview current state (insert - edit - display) mode vs2008 windows app [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot开发者_开发技巧 be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

how to determine datagridview current state (insert - edit - display) mode vs2008 windows applications


trans_dBindingSource.EndEdit();

if (stock_dataset.trans_d.GetChanges(DataRowState.Added) != null)
{
    saveToolStripButton.PerformClick();
}
if (stock_dataset.trans_d.GetChanges(DataRowState.Modified) != null)
{
    saveToolStripButton.PerformClick();
}
if (stock_dataset.trans_d.GetChanges(DataRowState.Unchanged) != null)
{
    return;
}


bindingsource.endedit();
if(dataset.datatable.getchanges(datarowstate.added) != null)
{
add mode
}

bindingsource.endedit();
if(dataset.datatable.getchanges(datarowstate.modefied) != null)
{
modify mode
}

bindingsource.endedit();
if(dataset.datatable.getchanges(datarowstate.unchanged) != null)
{
no changes mode
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜