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; - } - } -}