A core feature of Visual Studio that allows developers to inspect, analyze, and troubleshoot code during execution.
private void grdMaster_CurrentCellDirtyStateChanged(object sender, EventArgs e)
{
if (grdMaster.IsCurrentCellDirty)
{
grdMaster.CommitEdit(DataGridViewDataErrorContexts.Commit);
}
}
private void grdMaster_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0)
return;
DataGridViewRow row = grdMaster.Rows[e.RowIndex];
object tonnageObj = row.Cells["totalTonnage"].Value;
if (tonnageObj == null || tonnageObj == DBNull.Value)
return;
decimal totalTonnage;
if (!decimal.TryParse(tonnageObj.ToString(), out totalTonnage))
return;
foreach (DataGridViewRow detailRow in grdDetail.Rows)
{
// Update values in other grid
}
grdDetail.CommitEdit(DataGridViewDataErrorContexts.Commit);
}