protected override void OnKeyUp(KeyEventArgs e) { RadColorPickerEditorElement editorElement = this.EditorElement as RadColorPickerEditorElement; if (editorElement == null || !editorElement.IsInValidState(true)) { return; } int length = editorElement.Text.Length; switch (e.KeyCode) { case Keys.Left: if (this.selectionLength != 0 || (this.RightToLeft || this.selectionStart != 0) && (!this.RightToLeft || this.selectionStart != length)) { break; } this.ProcessKeyDown(e); break; case Keys.Right: if (this.selectionLength != 0 || (this.RightToLeft || this.selectionStart != length) && (!this.RightToLeft || this.selectionStart != 0)) { break; } this.ProcessKeyDown(e); break; } }
protected override void OnKeyDown(KeyEventArgs e) { RadColorPickerEditorElement editorElement = this.EditorElement as RadColorPickerEditorElement; if (editorElement == null || !editorElement.IsInValidState(true)) { return; } this.selectionStart = editorElement.TextBoxItem.SelectionStart; this.selectionLength = editorElement.TextBoxItem.SelectionLength; if (e.KeyCode == Keys.Return) { if (e.Modifiers != Keys.Control) { try { this.Value = (object)(Color)this.converter.ConvertFromString(editorElement.Text); } catch (Exception ex) { editorElement.Focus(); editorElement.TextBoxItem.SelectAll(); } this.ProcessKeyDown(e); return; } } if (e.KeyCode != Keys.Escape) { return; } this.ProcessKeyDown(e); e.Handled = true; }
protected override void OnKeyDown(KeyEventArgs e) { RadColorPickerEditorElement editorElement = this.EditorElement as RadColorPickerEditorElement; DataFilterCriteriaElement ownerElement = this.OwnerElement as DataFilterCriteriaElement; if (editorElement == null || !editorElement.IsInValidState(true) || ownerElement == null) { return; } this.selectionStart = editorElement.TextBoxItem.SelectionStart; this.selectionLength = editorElement.TextBoxItem.SelectionLength; if (e.KeyCode == Keys.Return && e.Modifiers != Keys.Control) { if (!this.Validate()) { return; } ownerElement.TreeViewElement.EndEdit(); } else if (e.KeyCode == Keys.Escape) { ownerElement.TreeViewElement.CancelEdit(); e.Handled = true; } else { if (e.KeyCode != Keys.Delete || editorElement.TextBoxItem.SelectionLength != editorElement.TextBoxItem.TextLength) { return; } editorElement.Text = string.Empty; } }
protected override void OnKeyUp(KeyEventArgs e) { RadColorPickerEditorElement editorElement = this.EditorElement as RadColorPickerEditorElement; DataFilterCriteriaElement ownerElement = this.OwnerElement as DataFilterCriteriaElement; if (editorElement == null || !editorElement.IsInValidState(true) || ownerElement == null) { return; } int length = editorElement.Text.Length; switch (e.KeyCode) { case Keys.Left: if ((!this.RightToLeft || this.selectionStart != editorElement.Text.Length) && (this.RightToLeft || this.selectionStart != 0 || this.selectionLength != 0)) { break; } editorElement.Validate(); break; case Keys.Right: if ((!this.RightToLeft || this.selectionStart != 0) && (this.RightToLeft || this.selectionStart != editorElement.Text.Length)) { break; } editorElement.Validate(); break; } }
public override void BeginEdit() { base.BeginEdit(); RadColorPickerEditorElement editorElement = this.EditorElement as RadColorPickerEditorElement; editorElement.ValueChanging += new ValueChangingEventHandler(this.editorElement_ValueChanging); editorElement.ValueChanged += new EventHandler(this.editorElement_ValueChanged); editorElement.DialogClosed += new DialogClosedEventHandler(this.editorElement_DialogClosed); }
public override bool EndEdit() { base.EndEdit(); RadColorPickerEditorElement editorElement = this.EditorElement as RadColorPickerEditorElement; editorElement.ValueChanging -= new ValueChangingEventHandler(this.editorElement_ValueChanging); editorElement.ValueChanged -= new EventHandler(this.editorElement_ValueChanged); editorElement.DialogClosed -= new DialogClosedEventHandler(this.editorElement_DialogClosed); editorElement.SetColorValue(Color.Empty); return(true); }
private void editorElement_DialogClosed(object sender, DialogClosedEventArgs e) { RadColorPickerEditorElement editorElement = this.EditorElement as RadColorPickerEditorElement; editorElement.DialogClosed -= new DialogClosedEventHandler(this.editorElement_DialogClosed); DataFilterCriteriaElement ownerElement = this.OwnerElement as DataFilterCriteriaElement; if (ownerElement == null) { return; } ownerElement.CriteriaNode.DescriptorValue = (object)editorElement.Value; ownerElement.Synchronize(); ownerElement.InvalidateMeasure(true); ownerElement.UpdateLayout(); ownerElement.TreeViewElement.UpdateScrollersOnNodesNeeded(ownerElement.Data); }