Compare commits

...

2 Commits

Author SHA1 Message Date
Loretta f9feff0bf5 MessageGrid improvements, fixes... 2024-08-20 14:55:20 +02:00
Loretta 7d56e6202e fix 2024-08-20 14:23:53 +02:00
1 changed files with 12 additions and 6 deletions

View File

@ -35,7 +35,7 @@
ShowFilterRow="ShowFilterRow">
<Columns>
<DxGridCommandColumn Width="135" MinWidth="135" Visible="AcDomain.IsDeveloperVersion" DeleteButtonVisible="AcDomain.IsDeveloperVersion" EditButtonVisible="AcDomain.IsDeveloperVersion" FixedPosition="GridColumnFixedPosition.Left"/>
<DxGridDataColumn FieldName="SenderId" Caption="/" Width="30px" ShowInColumnChooser="AcDomain.IsDeveloperVersion" DisplayFormat="N">
<DxGridDataColumn FieldName="SenderId" Caption=" " Width="30px" ShowInColumnChooser="AcDomain.IsDeveloperVersion" DisplayFormat="N" AllowSort="false">
<CellDisplayTemplate>
@{
var isOutgoing = ((EmailMessage)context.DataItem).SenderId == myUserId;
@ -85,19 +85,19 @@
</DxGridDataColumn>
<DxGridDataColumn FieldName="Id" Width="150" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N"/>
<DxGridDataColumn FieldName="ContextId" Width="150px" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N"/>
<DxGridDataColumn FieldName="Created" Caption="Received" DisplayFormat="g" Width="@(IsMessageTextVisible ? 140.ToString() : 80.ToString())" SortIndex="0" SortOrder="GridColumnSortOrder.Descending" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center">
<DxGridDataColumn FieldName="Created" Caption="Received" DisplayFormat="g" Width="@(IsMessageTextVisible ? 140.ToString() : 85.ToString())" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center">
<CellDisplayTemplate>
@{
var created = ((EmailMessage)context.DataItem).Created;
if (!IsMessageTextVisible)
if (IsMessageTextVisible)
{
<p style="padding: 3px; margin: 0 auto;">@created.ToString("yy.MM.dd")</p>
<p style="padding: 3px; margin: 0 auto;">@created.ToString("HH:mm")</p>
@created.ToString("g")
}
else
{
<text>@created.ToString("g")</text>
<div style="padding: 3px 3px 1px 3px; margin: 0 auto;">@created.ToString("d").Replace(" ", string.Empty)</div>
<div style="padding: 2px 3px 3px 3px; margin: 0 auto;">@created.ToString("t").Replace(" ", string.Empty)</div>
}
}
</CellDisplayTemplate>
@ -109,6 +109,12 @@
@{
var subjectString = ((EmailMessage)context.DataItem).Subject;
<p style="word-break: normal; white-space: normal; padding: 0; margin: 0 auto;">@subjectString</p>
if (!IsMessageTextVisible)
{
var textString = System.Text.RegularExpressions.Regex.Replace(((EmailMessage)context.DataItem).Text!, "<(.|\n)*?>", string.Empty);
<div style="padding-top: 3px; color: darkgray">@textString</div>
}
}
</CellDisplayTemplate>
</DxGridDataColumn>