Unplanned
Last Updated: 19 Dec 2019 14:11 by ADMIN
Danny
Created on: 16 Dec 2019 14:19
Category: Chat
Type: Bug Report
3
RadChat: scroll to the last item doesn't work correctly

hello, a few days ago in support ticket they gave me this as a solution to move to the last message of the RadChat, but it does not work, if I upload the item and then add a message it does not point me to the last one but the scroll remains in The position I leave, what I need is to know what event or how to make your RadChat the last element.

radChatSoporte.ChatElement.MessagesViewElement.Scroller.ScrollToItem(radChatSoporte.ChatElement.MessagesViewElement.Items.Last())

3 comments
ADMIN
Nadya | Tech Support Engineer
Posted on: 19 Dec 2019 14:11

Hello Danny,

Thank you for the provided video. I confirm that this is an issue with the ScrollToItem method in RadChat. In my test project, I observed the same wrong behavior (see attached files).

I have logged it in our feedback portal by making this thread public on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item. I have also updated your Telerik Points.

To work around this please refer to the following code snippet:

RadScrollBarElement scrollbar = radChat1.ChatElement.MessagesViewElement.Scroller.Scrollbar;
scrollbar.Value = 0;

while (scrollbar.Value < scrollbar.Maximum - scrollbar.LargeChange + 1)
{
    scrollbar.PerformSmallIncrement(1);
    radChat1.ChatElement.MessagesViewElement.Scroller.UpdateScrollRange();
    Application.DoEvents();
}

scrollbar.PerformLast();

I hope this information helps. If you need any further assistance please don't hesitate to contact me.

Regards,
Nadya
Progress Telerik

RadChat for Winforms
Danny
Posted on: 17 Dec 2019 21:05
Hi Nadya.
I did not understand, what you say if I know every time an element is added it moves to the last element, but what happens if it moves the scroll and continues to add, it does not go to the last, which is fine but then I want to give the option to go to the last element and does not go, it stays long before the last, the same happens when a message history is loaded, I send you a video, I hope you can understand me.
Attached Files:
ADMIN
Nadya | Tech Support Engineer
Posted on: 17 Dec 2019 13:31

Hello Danny,

The messages in RadChat can be added automatically by typing or programmatically in the code. According to your description, it is not clear how do you add the messages in your project. Could you please specify how you add the messages on your end? By default the RadChat scrolls to the last message. I prepared a sample project in order to test both approaches. It seems that they work as expected on my end. The RadChat scrolls to the last message when the messages are added programmatically and AutoAddUserMessages is set to false as well. You can see in the attached gif file.

If AutoAddUserMessages is set to true, the SendMessage event is fired when the user performs an action e.g hits the Enter key or clicks the Send message button. 

I have attached my sample project. Could you please specify the exact steps on how to reproduce the problem you are facing? Feel free to modify it in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance. 

I am looking forward to your reply.

Regards,
Nadya
Progress Telerik

RadChat for Winforms