Completed
Last Updated: 23 Jul 2018 09:47 by Dimitar
ADMIN
Dimitar
Created on: 13 Jun 2018 11:03
Category: UI for WinForms
Type: Bug Report
0
FIX. RadChat - wrong time separator when adding previous messages
To reproduce:
public RadForm1()
{
    InitializeComponent();
    var a = new Author(null, "John");
    for (int i = 0; i < 20; i++)
    {
        radChat1.AddMessage(new ChatTextMessage("Item" + i, a, DateTime.Now.AddDays(-(20 - i))));
    }
    new Telerik.WinControls.RadControlSpy.RadControlSpyForm().Show();

    this.radChat1.ChatElement.MessagesViewElement.TimeSeparatorInterval = TimeSpan.FromDays(1);
}

You will notice that there is today in several places. 

Workaround:
this.radChat1.ChatElement.MessagesViewElement.TimeSeparatorInterval = TimeSpan.Zero;

var a = new Author(null, "Forest Gump");
for (int i = 0; i < 20; i++)
{
    radChat1.AddMessage(new ChatTextMessage("Item" + i, a, DateTime.Now.AddDays(-(20 - i))));

    ChatTimeSeparatorDataItem separator = new ChatTimeSeparatorDataItem(new ChatTimeSeparatorMessage(DateTime.Now.AddDays(-(20 - i))));
    radChat1.ChatElement.MessagesViewElement.Items.Add(separator);
}

(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments