public void GetIDPFromDialog() { if (bsPlans.Count == 0 || bsPlans.Current == null) { return; } if (dgvPlans.CurrentRow == null || dgvPlans.CurrentRow.IsNewRow) { return; } var fm = new Form_PlanList(); var ret = fm.ShowMyDialogModal(); if (ret != DialogResult.OK) { return; } var dr = (dgvPlans.CurrentRow.DataBoundItem as DataRowView).Row as KlonsADataSet.PIECEWORK_CATALOGRow; if (dgvPlans.CurrentCell != null) { try { int ids = fm.SelectedValueInt; dgvPlans.BeginEdit(false); var c = dgvPlans.EditingControl as ComboBox; c.SelectedValue = ids; dgvPlans.EndEdit(); } catch (Exception) { } } }
public void GetIDPLFromDialog() { if (bsShR.Count == 0 || bsShR.Current == null) { return; } if (dgvShR.CurrentRow == null || dgvShR.CurrentRow.IsNewRow) { return; } var fm = new Form_PlanList(); var ret = fm.ShowMyDialogModal(); if (ret != DialogResult.OK) { return; } var dr = (dgvShR.CurrentRow.DataBoundItem as DataRowView).Row as KlonsADataSet.TIMESHEET_TEMPL_RRow; if (dgvShR.CurrentCell != null && dgvShR.CurrentCell.ColumnIndex == dgcShRIdPL.Index) { try { int id = fm.SelectedValueInt; dgvShR.BeginEdit(false); var c = dgvShR.EditingControl as ComboBox; c.SelectedValue = id; dgvShR.EndEdit(); } catch (Exception) { } } }