# Suggested Actions

**Conversational UI** supports adding message suggestions in the chat's UI that can be used easily send text to the chat.

## Adding the SuggestedAction

To add suggestions, use the `SuggestedActions` collection of `RadChat`.

```C#

private Author currentAuthor;
private Author otherAuthor;

public FeaturesSuggestedActions()
{
    InitializeComponent();

    currentAuthor = new Author("1") { Name = "Peter" };
    otherAuthor = new Author("2") { Name = "Steven" };
    this.chat.CurrentAuthor = currentAuthor;

    var textMessage = new TextMessage(this.currentAuthor, "Hello", "sent");
    textMessage.InlineViewModel.StatusVisibility = Visibility.Visible;

    this.chat.AddMessage(textMessage);

    this.chat.SuggestedActions.Add(new SuggestedAction("Hi, there!"));
}
```

![Adding a SuggestedAction](https://www.telerik.com/products/wpf/documentation/assets/d8ad3ac8c3f40464f12039de58379535/radchat_items_suggestedactions_01.png)

The `SuggestedActions` are visible by default. In case they need to hide the suggestions, set the `SuggestedActionsVisibility` property of `RadChat` to `Collapsed`.

## Handling the SuggestedActionReported event

When the user selects a given suggestion, the `SuggestedActionReported` is raised. Through it the user input can be modified. Its arguments expose the following members.

* `CloseAfterReport`: A boolean property that controls whether the message will be removed after it reports a result.
* `PostResultInline`: A boolean property that determines whether the suggestion should be posted as an inline text message or not.
* `Text`: The text result.

```C#

private void Chat_SuggestedActionReported(object sender, SuggestedActionsEventArgs e)
{
    if (e.Text == "Hi, there!")
    {
        e.CloseAfterReport = false;
        e.PostResultInline = false;

        this.chat.AddMessage(this.otherAuthor, e.Text);
    }
}
```

![Handling the SuggestedActionReported event](https://www.telerik.com/products/wpf/documentation/assets/2b7cf9694b486f4421da631e0b50fa03/radchat_items_suggestedactions_02.png)

## SuggestedActionsOrientation

To set the layout orientation of the suggested actions, use the `SuggestedActionsOrientation` property of `RadChat`.

```XAML
<telerik:RadChat x:Name="chat" SuggestedActionsOrientation="Vertical"/>
```

![SuggestedActions with Vertical orientation](https://www.telerik.com/products/wpf/documentation/assets/a1396e8e0ab141d36c300d5595cdf70e/radchat_items_suggestedactions_03.png)

## See Also

* [Overview](https://www.telerik.com/products/wpf/documentation/controls/radchat/overview)
* [Getting Started](https://www.telerik.com/products/wpf/documentation/controls/radchat/getting-started)
* [Messages Overview](https://www.telerik.com/products/wpf/documentation/controls/radchat/messages/overview)
