This page is a draft and may contain incorrect information and/or experimental styling.

Clearing value of LookupEdit control in XtraGrid


In a DevExpress XtraGrid control, a column with a control edit of LookupEdit type can be made to clear its value by using the delete key.

Natively, the ctrl-delete combination will delete the value from the column.

To get it to work with only the delete key, do the following:
private void cbo_KeyDown(object sender, KeyEventArgs e)
{
   // was the Delete key pressed?
   if (e.KeyCode == Keys.Delete)
   {
      // clear the current column on the grid of any data
      this.gridViewMyGrid.SetFocusedRowCellValue(this.MyGridColumn, null);
   }
}


Last modified by Mohit @ 4/8/2025 8:22:28 PM