开发者

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

开发者 https://www.devze.com 2023-01-08 01:25 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot开发者_开发技巧 be reasonably answered in its current form.
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

精彩评论

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