-
Data Grid
- Overview
-
Data Binding
-
Paging and Scrolling
-
Editing
-
Grouping
-
Filtering and Sorting
- Focused Row
-
Row Drag & Drop
-
Selection
-
Columns
- State Persistence
-
Appearance
-
Templates
-
Data Summaries
-
Master-Detail
-
Export to PDF
-
Export to Excel
-
Adaptability
- Keyboard Navigation
-
Pivot Grid
- Overview
-
Data Binding
-
Field Chooser
-
Features
-
Export to Excel
-
Tree List
- Overview
-
Data Binding
- Sorting
- Paging
-
Editing
- Node Drag & Drop
- Focused Row
-
Selection
-
Filtering
-
Column Customization
- State Persistence
- Adaptability
- Keyboard Navigation
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Features
- Virtual Scrolling
-
Grouping
-
Customization
- Adaptability
-
Html Editor
-
Chat
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
Charts
- Overview
-
Data Binding
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Line Charts
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
-
Sparkline Charts
-
Tree Map
-
Funnel and Pyramid Charts
- Sankey Chart
-
Combinations
-
More Features
-
Export
-
Selection
-
Tooltips
-
Zooming
-
-
Gantt
- Overview
-
Data
-
UI Customization
- Strip Lines
- Export to PDF
- Sorting
-
Filtering
-
Reporting
- AI-powered Extensions
-
Interaction
-
Report Types
-
Data binding
-
Real-life Reports
-
Layout Features
-
Report Controls
-
Web-specific Features
-
Rich Text Editor
- Overview
- Load/Save
- Document Protection
-
Templates
- Autocorrect
-
Customization
- Simple View
-
Spreadsheet
- Overview
-
Open a Document
- Export And Printing
-
Features
-
UI Customization
-
Gauges
- Overview
-
Data Binding
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Navigation
- Overview
- Accordion
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
- Resizable
-
-
Editors
- Overview
- Autocomplete
-
Calendar
- Check Box
- Color Box
- Date Box
-
Date Range Box
-
Drop Down Box
-
Number Box
-
Select Box
- Switch
-
Tag Box
- Text Area
- Text Box
- Validation
- Custom Text Editor Buttons
- Right-to-Left Support
- Editor Appearance Variants
-
Forms and Multi-Purpose
- Overview
- Button Group
- Field Set
-
Filter Builder
-
Form
- Radio Group
-
Range Selector
- Numeric Scale (Lightweight)
- Numeric Scale
- Date-Time Scale (Lightweight)
- Date-Time Scale
- Logarithmic Scale
- Discrete scale
- Custom Formatting
- Use Range Selection for Calculation
- Use Range Selection for Filtering
- Image on Background
- Chart on Background
- Customized Chart on Background
- Chart on Background with Series Template
- Range Slider
- Slider
-
Sortable
-
File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Actions and Lists
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
Chat - Overview
Chat is an interactive UI component designed to send/receive messages in real time.
To get started with the DevExtreme Chat component, refer to the following step-by-step tutorial: Getting Started with Chat.
The demo implements basic Chat functionality: specifies initial messages, updates the conversation with new incoming/outgoing messages, manages users, and links two chats in real-time.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
@model DevExtreme.NETCore.Demos.ViewModels.ChatViewModel
@(Html.DevExtreme().Chat()
.ID("user-chat")
.User(user => user
.Id(Model.CurrentUser.Id)
.Name(Model.CurrentUser.Name)
)
.DataSource(Model.Messages)
.ReloadOnChange(false)
.OnMessageEntered("onMessageEntered")
.OnTypingStart("userChatTypingStart")
.OnTypingEnd("userChatTypingEnd")
.OnInitialized("userChatInitialized")
)
@(Html.DevExtreme().Chat()
.ID("support-chat")
.User(user => user
.Id(Model.SupportAgent.Id)
.Name(Model.SupportAgent.Name)
.AvatarUrl(Model.SupportAgent.AvatarUrl)
)
.DataSource(Model.Messages)
.ReloadOnChange(false)
.OnMessageEntered("onMessageEntered")
.OnTypingStart("supportChatTypingStart")
.OnTypingEnd("supportChatTypingEnd")
.OnInitialized("supportChatInitialized")
)
<script>
var userChat, supportChat;
function userChatInitialized({ component }) {
userChat = component;
}
function supportChatInitialized({ component }) {
supportChat = component;
}
function onMessageEntered({ message }) {
userChat.renderMessage(message);
supportChat.renderMessage(message);
}
function userChatTypingStart({ user }) {
supportChat.option('typingUsers', [user]);
}
function userChatTypingEnd() {
supportChat.option('typingUsers', []);
}
function supportChatTypingStart({ user }) {
userChat.option('typingUsers', [user]);
}
function supportChatTypingEnd() {
userChat.option('typingUsers', []);
}
</script>
xxxxxxxxxx
using DevExtreme.NETCore.Demos.Models.SampleData;
using DevExtreme.NETCore.Demos.ViewModels;
using Microsoft.AspNetCore.Mvc;
namespace DevExtreme.NETCore.Demos.Controllers {
public class ChatController : Controller {
public ActionResult Overview() {
return View(new ChatViewModel {
CurrentUser = SampleData.CurrentUser,
SupportAgent = SampleData.SupportAgent,
Messages = SampleData.Messages,
});
}
}
}
xxxxxxxxxx
using DevExtreme.NETCore.Demos.Models.Chat;
using System;
using System.Collections.Generic;
namespace DevExtreme.NETCore.Demos.Models.SampleData {
public partial class SampleData {
private static readonly DateTime todayDate = DateTime.Now.Date;
private static DateTime GetTimestamp(DateTime date, int offsetMinutes = 0) {
DateTime adjustedDate = date.AddMinutes(offsetMinutes);
return adjustedDate;
}
public static ChatUser CurrentUser = new ChatUser {
Id = "c94c0e76-fb49-4b9b-8f07-9f93ed93b4f3",
Name = "John Doe"
};
public static ChatUser SupportAgent = new ChatUser {
Id = "d16d1a4c-5c67-4e20-b70e-2991c22747c3",
Name = "Support Agent",
AvatarUrl = "../../images/petersmith.png"
};
public static readonly IEnumerable<Message> Messages = new[] {
new Message {
Timestamp = GetTimestamp(todayDate, -9),
Author = SupportAgent,
Text = "Hello, John!\nHow can I assist you today?",
},
new Message {
Timestamp = GetTimestamp(todayDate, -7),
Author = CurrentUser,
Text = "Hi, I'm having trouble accessing my account.",
},
new Message {
Timestamp = GetTimestamp(todayDate, -7),
Author = CurrentUser,
Text = "It says my password is incorrect."
},
new Message {
Timestamp = GetTimestamp(todayDate, -7),
Author = SupportAgent,
Text = "I can help you with that. Can you please confirm your UserID for security purposes?"
},
new Message {
Timestamp = GetTimestamp(todayDate, 1),
Author = CurrentUser,
Text = "john.doe1357"
},
new Message {
Timestamp = GetTimestamp(todayDate, 1),
Author = SupportAgent,
Text = "✅ Instructions to restore access have been sent to the email address associated with your account."
}
};
}
}
xxxxxxxxxx
using DevExtreme.NETCore.Demos.Models.Chat;
using System.Collections.Generic;
namespace DevExtreme.NETCore.Demos.ViewModels {
public class ChatViewModel {
public IEnumerable<Message> Messages { get; set; }
public ChatUser CurrentUser { get; set; }
public ChatUser SupportAgent { get; set; }
}
}
xxxxxxxxxx
using System;
using System.Text.Json.Serialization;
namespace DevExtreme.NETCore.Demos.Models.Chat
{
public class Message {
[JsonPropertyName("timestamp")]
public DateTime Timestamp { get; set; }
[JsonPropertyName("text")]
public string Text { get; set; }
[JsonPropertyName("author")]
public ChatUser Author { get; set; }
}
}
xxxxxxxxxx
using System.Text.Json.Serialization;
namespace DevExtreme.NETCore.Demos.Models.Chat
{
public class ChatUser {
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("avatarUrl")]
public string AvatarUrl { get; set; }
}
}
xxxxxxxxxx
.demo-container {
display: flex;
gap: 20px;
}
.dx-chat {
height: 710px;
}
.dx-avatar {
border: 1px solid var(--dx-color-border);
}
Messages
To specify an initial message, you can populate the items array (shown in this demo) or use a dataSource.
Use the following API to render new messages:
- If using items, update the array with the new message.
- If using a dataSource, implement load and insert operations.
Users
To specify the chat owner, set the user property. Owner messages align to the right (or left in RTL mode) and do not display a name or avatar.
Each message includes information about the sender (author): name, avatar, and alternative avatar text. If no avatar is set, the user's initials are displayed instead.
Events
If a user enters a message, the Chat component raises the messageEntered event. Use the event handler to process the message. For example, you can display the message in the message feed and send the message to the server for storage.
When users start or complete text entry, our Chat component raises typingStart and typingEnd events. Use these events to manage the typingUsers array. The DevExtreme Chat uses this array to display a list of active users.