我用强类型dataset绑—ataGridView,如何将选中的currentrow又付给强类型dataset的row呢
我用强类型dataset绑—ataGridView,如何将选中的currentrow又付给强类型dataset的row呢
[解决办法]
直接可以去dataGridView的选中内容,最好这样
[解决办法]
粘全了吧:
private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
DataGridViewRow row = (sender as DataGridView).Rows[e.RowIndex];
DataRow dr = row.DataBoundItem as DataRow;
if (dr == null)
{
DataRowView dv = row.DataBoundItem as DataRowView;
if (dv != null)
{
dr = dv.Row;
}
}
}