From 4d6544d828835ef4687969ae66410b000671a47c Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo Date: Wed, 6 Oct 2021 08:25:08 -0600 Subject: [PATCH] Revert accidental push of changes in progress. --- AppScaffolding/AppScaffolding.csproj | 2 +- .../TruncatedDataGridViewTextBoxColumn.cs | 29 ------------------- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 LibationWinForms/TruncatedDataGridViewTextBoxColumn.cs diff --git a/AppScaffolding/AppScaffolding.csproj b/AppScaffolding/AppScaffolding.csproj index 4413fc22..afc57dae 100644 --- a/AppScaffolding/AppScaffolding.csproj +++ b/AppScaffolding/AppScaffolding.csproj @@ -3,7 +3,7 @@ net5.0 - 6.2.1.6 + 6.2.1.0 diff --git a/LibationWinForms/TruncatedDataGridViewTextBoxColumn.cs b/LibationWinForms/TruncatedDataGridViewTextBoxColumn.cs deleted file mode 100644 index a462e6e9..00000000 --- a/LibationWinForms/TruncatedDataGridViewTextBoxColumn.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel; -using System.Windows.Forms; - -namespace LibationWinForms -{ - public class TruncatedDataGridViewTextBoxColumn : DataGridViewTextBoxColumn - { - public TruncatedDataGridViewTextBoxColumn() - { - CellTemplate = new TruncatedDataGridViewTextBoxCell(); - } - } - - internal class TruncatedDataGridViewTextBoxCell : DataGridViewTextBoxCell - { - private const int MAX_DISPLAY_CHARS = 63; - private string truncatedString; - - protected override object GetFormattedValue(object value, int rowIndex, ref DataGridViewCellStyle cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context) - { - if (value is null || value is not string valueStr) - return value; - - truncatedString ??= valueStr.Length < MAX_DISPLAY_CHARS ? valueStr : valueStr.Substring(0, MAX_DISPLAY_CHARS - 1) + "…"; - - return truncatedString; - } - } -}