Note that there are some explanatory texts on larger screens.

plurals
  1. POHow i can get result on cell leave event of datagrid view?
    primarykey
    data
    text
    <p>Here is my code That displays multiplication of Rate * Supply column values and assign it to the Amount column in data grid view :</p> <pre><code>try { Query = "Select id,Code,Description,Rate,Cust_Id,Supply,Empty,Amount,Received from Items where Cust_Id='" + GlobalVars.id + "'"; adap = new SQLiteDataAdapter(Query, GlobalVars.conn); ds = new DataSet(); adap.Fill(ds, "Items"); dtgVOuchers.DataSource = ds.Tables[0]; dtgVOuchers.Columns["Cust_Id"].Visible = false; dtgVOuchers.Columns["id"].Visible = false; ds.Tables[0].Columns["id"].AutoIncrement = true; ds.Tables[0].Columns["id"].AutoIncrementSeed = itmcount + 1; ds.Tables[0].Columns["id"].AutoIncrementStep = 1; ds.Tables[0].Columns["Cust_Id"].DefaultValue = GlobalVars.id; dtgVOuchers.Columns["Code"].ReadOnly = true; dtgVOuchers.Columns["Description"].ReadOnly = true; dtgVOuchers.Columns["Rate"].ReadOnly = true; dtgVOuchers.Columns["Amount"].ReadOnly = true; foreach (DataGridViewRow row in dtgVOuchers.Rows) { row.Cells[dtgVOuchers.Columns["Amount"].Index].Value = (Convert.ToDouble(row.Cells[dtgVOuchers.Columns["Rate"].Index].Value) * Convert.ToDouble(row.Cells[dtgVOuchers.Columns["Supply"].Index].Value)); } dtgVOuchers.Refresh(); } </code></pre> <p>This multiplication is done if i double click on "Amount" cell in datagrid view and get resultant amount in corresponding cell . What i want is to get multiplication result in corresponding cell on cell leave event .It means when user leave the cell of "Supply" or "Rate" by typing value then this event provide the update to corresponding "Amount" cell so that user don't need double click on cell where he wants result. Can somebody guide me how i can accomplish this ?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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