Hello, Tim,
RadChat allows you to create custom items and add any element that you need in the chat messages. A sample approach is demonstrated in the following help article:
https://docs.telerik.com/devtools/winforms/chat/customizing-appearance/custom-items
When you need to offer the user a list of options, the
ChatListOverlay is the appropriate solution as you can select an item from a predefined list of choices. If you wish to display a
RadMultiColumnComboBox you can create a custom
ChatListOverlay. a sample approach is demonstrated in the following code snippet:
public
RadForm1()
{
InitializeComponent();
CustomBaseChatItemOverlay listOverlay =
new
CustomBaseChatItemOverlay(
"List overlay"
);
DataTable dt =
new
DataTable();
dt.Columns.Add(
"Id"
,
typeof
(
int
));
dt.Columns.Add(
"Name"
,
typeof
(
string
));
for
(
int
i = 0; i < 10; i++)
{
dt.Rows.Add(i,
"Item"
+ i);
}
listOverlay.Mccb.DisplayMember =
"Name"
;
listOverlay.Mccb.ValueMember =
"Id"
;
listOverlay.Mccb.DataSource = dt;
bool
showAsPopup =
false
;
Author author =
new
Author(Properties.Resources.AndrewFuller,
"Andrew"
);
this
.radChat1.Author = author;
ChatOverlayMessage overlayMessage =
new
ChatOverlayMessage(listOverlay, showAsPopup, author, DateTime.Now);
this
.radChat1.AddMessage(overlayMessage);
}
public
class
CustomBaseChatItemOverlay : BaseChatItemOverlay
{
public
CustomBaseChatItemOverlay(
string
title) :
base
(title)
{
this
.mccb.SelectedValueChanged += mccb_SelectedValueChanged;
}
public
RadMultiColumnComboBox Mccb
{
get
{
return
this
.mccb;
}
}
private
void
mccb_SelectedValueChanged(
object
sender, EventArgs e)
{
if
(
this
.mccb.SelectedItem !=
null
)
{
this
.CurrentValue =
this
.mccb.SelectedValue;
}
}
RadMultiColumnComboBox mccb;
protected
override
Telerik.WinControls.RadElement CreateMainElement()
{
mccb =
new
RadMultiColumnComboBox();
return
new
RadHostItem(
this
.mccb);
}
protected
override
void
DisposeManagedResources()
{
this
.mccb.SelectedValueChanged -= mccb_SelectedValueChanged;
base
.DisposeManagedResources();
}
}
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Progress TelerikRadChat for Winforms