Failure to validate, but cannot remove in DataGridView

后端 未结 1 1608
有刺的猬
有刺的猬 2021-01-19 16:41

This is in my RowValidation function of DataGridView:

        DataGridViewRow row = viewApplications.Rows[e.RowIndex];
        if (row.Cells[colApplyTo.Index         


        
相关标签:
1条回答
  • 2021-01-19 17:05

    To remove the row outside the handler, you can call BeginInvoke:

    BeginInvoke(new Action(delegate { viewApplications.Rows.RemoveAt(e.RowIndex); }));
    

    This will run the code in the delegate during the next message loop.

    0 讨论(0)
提交回复
热议问题