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())
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
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