D
dbuchanan
Hello,
I have set my dgv to MultiSelect = False and SelectionMode = FullRowSelect.
How to I programatically make a specific row current?
Additional detail relevent to what I am trying to do...
When the user has a specific row selected and clicks the edit button a
dedicated edit form opens. After completing and saving the edit that form
closes and the dgv on the main form refreshes (fill again). Therefore the
selected row is lost to the user. I want the slection to be preserved for
the user. How do I do this?
My current code...
private int pkMTaskIdDgvMTasksCurrentRow()
{
return (int)dgvMTasks.CurrentRow.Cells[0].Value;
}
private void btnAddViewEditTasks_Click(object sender, EventArgs e)
{
//Open with the desired value
AddEditMasterTask f = new
AddEditMasterTask(pkMTaskIdDgvMTasksCurrentRow());
f.ShowDialog();
taVwMTask_PhaseDimUnit2.Fill(dataSetHipAdmin2.vwMTask_PhaseDimUnit2);
// code here to set the current row back to what it was
}
Thank you,
Doug
I have set my dgv to MultiSelect = False and SelectionMode = FullRowSelect.
How to I programatically make a specific row current?
Additional detail relevent to what I am trying to do...
When the user has a specific row selected and clicks the edit button a
dedicated edit form opens. After completing and saving the edit that form
closes and the dgv on the main form refreshes (fill again). Therefore the
selected row is lost to the user. I want the slection to be preserved for
the user. How do I do this?
My current code...
private int pkMTaskIdDgvMTasksCurrentRow()
{
return (int)dgvMTasks.CurrentRow.Cells[0].Value;
}
private void btnAddViewEditTasks_Click(object sender, EventArgs e)
{
//Open with the desired value
AddEditMasterTask f = new
AddEditMasterTask(pkMTaskIdDgvMTasksCurrentRow());
f.ShowDialog();
taVwMTask_PhaseDimUnit2.Fill(dataSetHipAdmin2.vwMTask_PhaseDimUnit2);
// code here to set the current row back to what it was
}
Thank you,
Doug