This is a migrated thread and some comments may be shown as answers.

Position of a message

1 Answer 63 Views
Conversational UI, Chat
This is a migrated thread and some comments may be shown as answers.
Hemesh
Top achievements
Rank 1
Hemesh asked on 06 Jun 2019, 09:23 AM

Hello,

How can i get position of a message in the whole conversation of chat UI. So that i will be able to auto scroll the chat to that location. So that the particular msg can be highlighted.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 07 Jun 2019, 10:13 AM
Hi Hemesh,

You can use the following approach for this (the Items collection of the view element contains all messages):
private void RadButton1_Click(object sender, EventArgs e)
{
    var messageData = radChat1.ChatElement.MessagesViewElement.Items[4];
    var textMessage = messageData.Message as ChatTextMessage;
    radChat1.ChatElement.MessagesViewElement.Scroller.ScrollToItem(messageData);
}

I hope this helps. Should you have any other questions, do not hesitate to ask.
 
Regards,
Dimitar
Progress TelerikRadChat for Winforms
Tags
Conversational UI, Chat
Asked by
Hemesh
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or