Bugfix correct child_id from datagridview.
This commit is contained in:
parent
2786439c52
commit
5b286c4930
@ -78,11 +78,11 @@ namespace GreatHomeChildcare
|
|||||||
//PB&J: get currently selected row from dgv, then pass to GetChildByID() to get Child object.
|
//PB&J: get currently selected row from dgv, then pass to GetChildByID() to get Child object.
|
||||||
private void btnUpdate_Click(object sender, EventArgs e)
|
private void btnUpdate_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
child_id = dgvChildren.CurrentRow.Index;
|
/* Get the child's database ID which is secretly hidden
|
||||||
|
* in the datagrid view at column 0. Since value is an
|
||||||
//child_id must be incremented as the index starts at 0.
|
* Object, cast it to Int because that's what we know it is.
|
||||||
//TODO: FIX BUG!!
|
*/
|
||||||
child_id++;
|
child_id = (int)dgvChildren.CurrentRow.Cells[0].Value;
|
||||||
|
|
||||||
ShowChildCrudForm();
|
ShowChildCrudForm();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user