Is the radchat able to be saved?

1 Answer 26 Views
General Discussions
Willy
Top achievements
Rank 2
Iron
Iron
Willy asked on 16 Feb 2022, 06:46 PM | edited on 16 Feb 2022, 07:29 PM

I am using the winforms version. Is it possible to save the chat easily? I would like to save it to sql server. I tried to serialize the radChat but it says it's not marked as serializable and I don't see any sort of save method. I am guessing I need to create a helper that can store all the messages and serialize that? I do not see any examples on how to enumerate each message? Just a little direction if anybody knows. 

 

Thanks!

JeffSM
Top achievements
Rank 2
Veteran
Iron
commented on 17 Feb 2022, 12:02 AM

Hello Bill!

Would be nice if we had radChat.Save() and .Restore().

Best,

Jefferson

1 Answer, 1 is accepted

Sort by
1
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Feb 2022, 07:19 AM
Hello, Bill,

Currently, RadChat doesn't provide default functionality for storing its messages into an external file and loading these messages later.

However, I believe that such behavior can be easily achieved. You can iterate the ChatElement.MessagesViewElement.Items collection in order to traverse all messages that are currently available in the chat. Then, store the necessary information into an external file in the appropriate format for your scenario. Then, you can read the external file and considering the information you stored, use the AddMessage method that RadChat offers to load the desired messages. Additional information how to add messages and what are the different message types is available here: https://docs.telerik.com/devtools/winforms/controls/chat/chat-items/messages   

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

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Willy
Top achievements
Rank 2
Iron
Iron
commented on 17 Feb 2022, 02:26 PM

Consider this a feature request then! :) 
Willy
Top achievements
Rank 2
Iron
Iron
commented on 17 Feb 2022, 02:31 PM | edited

I figured it out thank you!
Dess | Tech Support Engineer, Principal
Telerik team
commented on 17 Feb 2022, 02:35 PM

Hi, Bill,

Thank you for the provided feedback. If other customers have similar requests, we will consider it in the future improvement of the RadChat control.

I am glad that the second question is now resolved. I would recommend you to have a look at the RadChat's elements structure and get familiar with the internal hierarchy:

https://docs.telerik.com/devtools/winforms/controls/chat/structure 

Tags
General Discussions
Asked by
Willy
Top achievements
Rank 2
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or