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

RadChat Messages not updated when Datasource changed

3 Answers 82 Views
Chat (Conversational UI)
This is a migrated thread and some comments may be shown as answers.
Kamran
Top achievements
Rank 2
Iron
Veteran
Iron
Kamran asked on 11 Nov 2018, 08:04 AM

Dear Team,

I am facing issue with Chat Control. When I tried to change datasource of control, Messages in Chat UI does not reflect.

I have List of User in listbox. Each User has Observable collection of TextMessages. When User selection changed, I bind datasource to selected user messages. I assume that Chat control will update its UI by selected User messaged. But it is not working.

I tried to clear MessageListItems on selection change, and re-bind datasource to selected user's messages. In this case Chat UI does not show any messages.

 

For reference I have uploaded my sample project on Google drive.

Messenger App

@Admin: I had already shared the same issue few days ago, but i did not receive any solution.

 

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 14 Nov 2018, 03:04 PM
Hello Kamran,

Thank you for the provided demo.

I would firstly like to clarify, that our general practice for attaching a sample application is by opening a new support ticket. Our ticketing system allows attaching archived projects only in such thread. I am also unable to compile to the linked demo due to some nuget dependencies. Nevertheless, switching the DataSource should be a trivial operation so I have demonstrated how it can be achieved in a sample project. Can you please check it out? You can see that when setting a new source instance, the older messages are kept. If removing them is the behavior you are aiming at, you can call the Clear method of the source collection. I have commented out the approach in the sample application in the Button Click event handler.

I hope this helps.

Regards,
Stefan
Progress TelerikWant to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Kamran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 15 Nov 2018, 05:28 AM

Thanks Stefan,

I your proposed solution you have Messages in VM, but in mine case my messages are kept in each user object, so when I select user from list, i set SelectedItem object in VM. where Selected Item is type of User having ObservableCollection of Messages. So when change selection, datasource changes, and list down what ever messages in selectedItem. Theoretically it should work fine, but I getting strange behavior.

I have cleanup my demo by removing unnecessary nugets and posted as ticket 1357293. Can you please look into posted ticket. 

0
Stefan
Telerik team
answered on 16 Nov 2018, 04:53 PM
Hi Kamran,

Thank you for the update.

I already replied you in the support thread you opened regarding the issue. Here is a link to the issue in our Feedback Portal which I logged based on your report: item.

Again, thank you for all your cooperation.

Regards,
Stefan
Progress TelerikWant to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Chat (Conversational UI)
Asked by
Kamran
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Stefan
Telerik team
Kamran
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or