Revert accidental push of changes in progress.
This commit is contained in:
parent
8098564926
commit
4d6544d828
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<Version>6.2.1.6</Version>
|
<Version>6.2.1.0</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user