From cc9410439a96a822f6584273def57f6b39fc28d2 Mon Sep 17 00:00:00 2001 From: Lior Banai Date: Mon, 21 Jun 2021 20:53:00 +0300 Subject: [PATCH] fix [UI] Typing non numerical text in numerical fields causes exception #823. fix #823 --- Analogy/UserControls/UCLogs.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Analogy/UserControls/UCLogs.cs b/Analogy/UserControls/UCLogs.cs index e1edb2f8..08724003 100644 --- a/Analogy/UserControls/UCLogs.cs +++ b/Analogy/UserControls/UCLogs.cs @@ -34,6 +34,7 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; +using DevExpress.XtraEditors.Mask; namespace Analogy { @@ -280,6 +281,7 @@ private void rgSearchMode_SelectedIndexChanged(object s, EventArgs e) } private void SetupEventsHandlers() { + logGrid.ShownEditor += GridView_ShownEditor; gridControl.Click += (s, e) => { if (btsAutoScrollToBottom.Checked) @@ -707,7 +709,15 @@ private void SetupEventsHandlers() #endregion } - + private void GridView_ShownEditor(object sender, System.EventArgs e) + { + var view = sender as GridView; + if (view.IsFilterRow(view.FocusedRowHandle) && view.FocusedColumn.FieldName == gridColumnProcessID.FieldName || view.FocusedColumn.FieldName == gridColumnThread.FieldName) + ((TextEdit)view.ActiveEditor).Properties.MaskSettings.Configure(settings => + { + settings.MaskExpression = "d"; + }); + } private void RefreshTimeOffset() { PagingManager.UpdateOffsets();