Hello,
Very new to Telerik Components.
I am using Telerik Gridview with different column types like multicombobox, decimal, combo box etc., Now I need to do validation each cells and written code for validation in CellValidating event of Gridview. it is validating properly. but I need to clear the cell content which is not happening.
I red other articles regarding the same and i initialize a cell validating event in the editor (Multicombobox editor). in this case the event itself is not firing.
kindly help me sort this issue.
I am attaching code snip shot for your ref.
Grid level Cell validation event
private void grddisplaygrid_CellValidating(object sender, CellValidatingEventArgs e)
{
e.Cancel = true;
grddisplaygrid.CurrentRow.Cells[0].Value = string.Empty;
}
in editor level (keydown event is firing but the validaiting event is not firing
-----------------------
private void grddisplaygrid_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
if (this.grddisplaygrid.CurrentColumn is GridViewMultiComboBoxColumn)
{
RadMultiColumnComboBoxElement editor = e.ActiveEditor as RadMultiColumnComboBoxElement;
if (editor != null)
{
iscellintialized = true;
editor.EditorControl.EnableFiltering = true;
editor.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
editor.ClearTextOnValidation = false;
editor.Text = "";
RadMultiColumnComboBoxElement editorElement = editor.EditorElement as RadMultiColumnComboBoxElement; //_gridEditor.EditorElement as RadItem;
editorElement.KeyDown += new KeyEventHandler(MultiComboboxeditor_KeyDown); //.KeyDown += new KeyEventHandler(radGridView1_KeyDown);
editorElement.Validating += new CancelEventHandler(editor_validaitng);
editorElement.Validated += new EventHandler(editor_validated);
}
}
}
private void editor_validated(object sender, EventArgs e)
{
throw new NotImplementedException();
}
private void editor_validaitng(object sender, CancelEventArgs e)
{
//throw new NotImplementedException();
}