Hi, I have a class wich receives a form as parameter 

public EspecificPercent(CalcPosicao Parentform, int index)
{
            InitializeComponent();

            IndexRow = index;

            workForm = Parentform;
}

Then, I want change the value of a cell on Parentform.datagridview1 and, after, 
I change this value, raise the CellEndEdit event, because this event call a 
method that do a lot of stuffs with the data from datagridview, but I don´t 
know how to do this, I tried this code:

private void registraboletas()
        {
            int i = 0;

            try
            {
                int IndexColumn = 
workForm.datagridview1.Rows[IndexRow].Cells["CONTRACTSC"].ColumnIndex;

                               
                workForm.datagridview1.Rows[IndexRow].Cells["CONTRACTSC"].value 
= newValue;

                workForm.datagridview1.CellEnter += new 
System.Windows.Forms.DataGridViewCellEventHandler(workForm.datagridview1_CellEndEdit);
                workForm.datagridview1_CellEndEdit(workForm.datagridview1, new 
DataGridViewCellEventArgs(IndexColumn, IndexRow));
                workForm.datagridview1.EndEdit();
            }
            catch { }

        }

The code above doesn´t work, the 
"workForm.datagridview1.Rows[IndexRow].Cells["CONTRACTSC"].value" has changed, 
but it doesn´t raise the endEdit event. 

Anyone knows how can I raise the event after I change the cell value ?

Thanks, 
Renato



      

Reply via email to