Example #1
0
        private void gridEmployees_CellValidating(object sender, Telerik.WinControls.UI.CellValidatingEventArgs e)
        {
            if (e.RowIndex < 0)  // Don't check if it's the new adding row
            {
                return;
            }
            switch (gridEmployees.CurrentColumn.Name)
            {
            case "FirstName":
                // First name cannot be empty
                if (Helper.ConvertToString(e.Value) == string.Empty)
                {
                    Helper.ShowError("Input the First Name of Employee.");
                    e.Cancel = true;
                }
                break;

            case "LastName":
                // Last Name cannot be empty
                if (Helper.ConvertToString(e.Value) == string.Empty)
                {
                    Helper.ShowError("Input the Last Name of Employee.");
                    e.Cancel = true;
                }
                break;

            default:
                break;
            }
        }
Example #2
0
        private void gridViewTranslation_CellValidating(object sender, Telerik.WinControls.UI.CellValidatingEventArgs e)
        {
            RadTextBoxEditor editor = e.ActiveEditor as RadTextBoxEditor;

            if (editor != null)
            {
                RadTextBoxEditorElement element = editor.EditorElement as RadTextBoxEditorElement;
                SpellChecker.Check(element.TextBoxItem.HostedControl);
                correctedValue = e.ActiveEditor.Value.ToString();
            }
        }
Example #3
0
        private void grdTimeLog_CellValidating(object sender, Telerik.WinControls.UI.CellValidatingEventArgs e)
        {
            switch (Util.ToUpper(e.Column.Name))
            {
            case "COLSTARTNAME":
                break;

            default:
                break;
            }
        }
        private bool RaiseCellValidatingEvent(
            GridViewRowInfo row,
            GridViewColumn column,
            object newValue,
            object oldValue)
        {
            CellValidatingEventArgs args = new CellValidatingEventArgs(row, column, newValue, oldValue, this.activeEditor);

            this.gridViewElement.Template.EventDispatcher.RaiseEvent <CellValidatingEventArgs>(EventDispatcher.CellValidating, (object)this, args);
            return(args.Cancel);
        }