Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Normally I test out my answers before I give them, but I'm operating away from my dev PC, so I'm not 100% sure which route is best, but here are some ideas to try out.</p> <p>On a DataGridView, you can use the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellendedit.aspx" rel="nofollow noreferrer">CellEndEdit</a> event to tell when a cell has been edited. there's also a <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellleave.aspx" rel="nofollow noreferrer">CellLeave</a> event, but I haven't used it and yo may need to experiment with it.</p> <p>On a DataGrid, you can use the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagrid.currentcellchanged.aspx" rel="nofollow noreferrer">CurrentCellChanged</a> event.</p> <p>However, to do any calculations, you will need to extract your values fron the underlying Dataable or DataView (depending on what the control is bound to). I'v also found that using the DataGrid.CurrentCellChanged event is buggy and it's throwwn when the DataGrid is databaound, not just when a user edits the contents, so you may need to contend with that... I would imagine that the DataGridView's CellLeave event might have similar issues. Like I said, I'm not 100% sure, so you'll need to experiment.</p> <p>Also, as Kyle suggested, you could try to use events from the underlying DataSource.</p> <p>DataTable.RowChanged or DataView.ListChanged events wouldbe where I would start.</p> <p>As I said, I am unable to test these myself, but hopefully one of these ideas will point you in the right direction.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload