Skip to content

Commit

Permalink
fix [UI] Typing non numerical text in numerical fields causes exception
Browse files Browse the repository at this point in the history
#823.

fix #823
  • Loading branch information
LiorBanai committed Jun 21, 2021
1 parent cc4a0c9 commit cc94104
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Analogy/UserControls/UCLogs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors.Mask;

namespace Analogy
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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<MaskSettings.Numeric>(settings =>
{
settings.MaskExpression = "d";
});
}
private void RefreshTimeOffset()
{
PagingManager.UpdateOffsets();
Expand Down

0 comments on commit cc94104

Please sign in to comment.