Reversed Order of Chat Messages
Environment
Product Version | Product | Author |
---|---|---|
2021.3.914 | RadChat for WinForms | Desislava Yordanova |
Description
The messages in RadChat are arranged from top to bottom ordered according to their order of adding to the collection. Hence, the last added messages are added on last (bottom) position. This is the expected layout for all world-known chat applications.
A common requirement is to reverse the order of chat messages.
Solution
If you want to add the messages in a reversed order, it is necessary to plug into the logic for adding messages in the chat view. By default, when you type in the text box and confirm the message, it is automatically added to RadChat. This behavior can be controlled by the AutoAddUserMessages property. In addition, the SendMessage event is fired each time a new message is about to be added to the chat UI. It is allowed to modify the message itself or adjust whether the message will be added or inserted at position 0.