DeveXPress XtraGrid 删除键删除

private void gridDeliveryDetail_KeyDown( object sender, KeyEventArgs e)
        {
           
if (e.KeyCode == Keys.Delete)
            {
               
if (MessageBox.Show( " 删除行? " , " 确认 " , MessageBoxButtons.YesNo) != DialogResult.Yes)
                   
return ;
               
int i = viewDeliveryDetail.FocusedRowHandle;
               
if (i >= 0 )
                {
                    viewDeliveryDetail.DeleteRow(i);
                }
            }
        }

你可能感兴趣的:(DevExpress)