בלאט 1 פון 1

(EventArgs csharp (Resolved

פארעפענטליכט: דינסטאג ינואר 22, 2013 10:19 am
דורך פאטאקי08
איך וויל רופן די מעטהאד פון א באטטאן פאר יעדע רייע אינעם גריד
מיין שאלה איז וויאזוי פעס איך אריין די DataGridViewCellEventArgs פאר די מעטהאד
זעה בילד

דא איז די מעטהאד
קאוד:
        private void recipeIngredientsDataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0 && e.ColumnIndex != 5)
            {
                try
                {
                    DataGridView dgv = this.recipeIngredientsDataGridView;
                    Int32 ingredientID = (Int32)dgv.Rows[e.RowIndex].Cells[2].Value;
                    decimal numberOfUnits = (decimal)dgv.Rows[e.RowIndex].Cells[3].Value;
                    Int32 unitMeasureID = (Int32)dgv.Rows[e.RowIndex].Cells[4].Value;

                    RecipeIngredient ri = new RecipeIngredient(ingredientID, numberOfUnits, unitMeasureID);
                    if (ri.Cost == 999999m)
                    {
                        MessageBox.Show("Could Not Calculate Cost!");
                        dgv.Rows[e.RowIndex].Cells[5].Value = 0m;
                        CalcRecipeCost(dgv);
                    }
                    else
                    {
                        dgv.Rows[e.RowIndex].Cells[5].Value = ri.Cost;
                        CalcRecipeCost(dgv);
                    }

                }
                catch (Exception)
                {
                }
            }
        }

פארעפענטליכט: דינסטאג ינואר 22, 2013 10:29 am
דורך תרגום יונתן
דאס?

קאוד:
recipeIngredientsDataGridView_CellValueChanged(dgv, new DataGridViewCellEventArgs (0, row.Index));


פארעפענטליכט: דינסטאג ינואר 22, 2013 10:40 am
דורך פאטאקי08
WOW!
אזוי שנעל?
שכח אייך ;l;p- ;l;p-
ארבעט פיין

פארעפענטליכט: דינסטאג ינואר 22, 2013 10:45 am
דורך תרגום יונתן
זייער גערן.