public override bool EndEdit() { RadDropDownListEditorElement element = this.EditorElement as RadDropDownListEditorElement; string text = element.Text; RadListDataItem item = null; foreach (RadListDataItem entry in element.Items) { if (entry.Text == text) { item = entry; break; } } if ((item == null) && (InputValueNotFound != null)) { // Get cell for handling CellEndEdit event this.cell = (this.EditorManager as GridViewEditManager).GridViewElement.CurrentCell; // Add event handling for setting value to cell (this.OwnerElement as GridComboBoxCellElement).GridControl.CellEndEdit += new GridViewCellEventHandler(OnCellEndEdit); this.e = new InputValueNotFoundArgs(element); this.InputValueNotFound(this, this.e); } return(base.EndEdit()); }
/// <summary> /// Puts added value into cell value /// </summary> /// <param name="sender">Event source of type GridViewEditManager</param> /// <param name="e">Event arguments</param> /// <remarks>Connected to GridView event CellEndEdit</remarks> protected void OnCellEndEdit(object sender, GridViewCellEventArgs e) { if (this.e != null) { // Handle only added value, others by default handling of grid if ((this.cell == (sender as GridViewEditManager).GridViewElement.CurrentCell) && this.e.ValueAdded) { e.Row.Cells[e.ColumnIndex].Value = this.e.Value; } this.e = null; } }