New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring the Kendo UI PromptBox

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class PromptBoxBuilder : WidgetBuilderBase<PromptBox, PromptBoxBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<PromptBox, PromptBoxBuilder>PromptBoxBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<PromptBox, PromptBoxBuilder>.ToComponent()WidgetBuilderBase<PromptBox, PromptBoxBuilder>.Expression(string)WidgetBuilderBase<PromptBox, PromptBoxBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<PromptBox, PromptBoxBuilder>.Name(string)WidgetBuilderBase<PromptBox, PromptBoxBuilder>.Deferred(bool)WidgetBuilderBase<PromptBox, PromptBoxBuilder>.HtmlAttributes(object)WidgetBuilderBase<PromptBox, PromptBoxBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<PromptBox, PromptBoxBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<PromptBox, PromptBoxBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<PromptBox, PromptBoxBuilder>.Render()WidgetBuilderBase<PromptBox, PromptBoxBuilder>.ToHtmlString()WidgetBuilderBase<PromptBox, PromptBoxBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<PromptBox, PromptBoxBuilder>.ToClientTemplate()WidgetBuilderBase<PromptBox, PromptBoxBuilder>.AsModule(bool)WidgetBuilderBase<PromptBox, PromptBoxBuilder>.ComponentWidgetBuilderBase<PromptBox, PromptBoxBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the PromptBoxBuilder class.

C#
public PromptBoxBuilder(PromptBox component)
Parameters:componentPromptBox

Methods

Configures the Action button (send/stop) in the end affix. The button is always visible. When null or not configured, the button is enabled by default. Use { enable: false } to disable it.

C#
public PromptBoxBuilder ActionButton(Action<PromptBoxActionButtonSettingsBuilder> configurator)
Parameters:configuratorAction<PromptBoxActionButtonSettingsBuilder>

The PromptBoxActionButtonSettingsBuilder for the actionbutton setting.

Returns:

PromptBoxBuilder

Returns the current instance of PromptBoxBuilder .

If set to false, the widget will be disabled and will not allow user input. The widget is enabled by default and allows user input.

C#
public PromptBoxBuilder Enable(bool value)
Parameters:valuebool

The value for Enable

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Defines a custom template for the end affix area. The end affix is positioned after the input field and typically contains action buttons.When the built-in PromptBox buttons are enabled, the authored end-affix content stays in place and the framework backfills any missing built-in controls after it inside the same end-affix container. To adopt a custom element instead of the default control, include ref-promptbox-send-button, ref-promptbox-file-select-button, or ref-promptbox-speech-to-text-button on the authored element.

C#
public PromptBoxBuilder EndAffixTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the endaffixtemplate.

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Defines a custom template for the end affix area. The end affix is positioned after the input field and typically contains action buttons.When the built-in PromptBox buttons are enabled, the authored end-affix content stays in place and the framework backfills any missing built-in controls after it inside the same end-affix container. To adopt a custom element instead of the default control, include ref-promptbox-send-button, ref-promptbox-file-select-button, or ref-promptbox-speech-to-text-button on the authored element.

C#
public PromptBoxBuilder EndAffixTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for EndAffixTemplate

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Configures the client-side events.

C#
public PromptBoxBuilder Events(Action<PromptBoxEventBuilder> configurator)
Parameters:configuratorAction<PromptBoxEventBuilder>

The client events action.

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Example:
C#
@(Html.Kendo().PromptBox()
.Name("PromptBox")
.Events(events =&gt; events
.Blur("onBlur")
)
)

Controls the visibility and configuration of the File Select button in the end affix. When enabled, users can attach files to their prompts.

C#
public PromptBoxBuilder FileSelectButton()
Returns:

PromptBoxBuilder

Returns the current instance of PromptBoxFileSelectButtonSettingsBuilder .

Controls the visibility and configuration of the File Select button in the end affix. When enabled, users can attach files to their prompts.

C#
public PromptBoxBuilder FileSelectButton(Action<PromptBoxFileSelectButtonSettingsBuilder> configurator)
Parameters:configuratorAction<PromptBoxFileSelectButtonSettingsBuilder>

The PromptBoxFileSelectButtonSettingsBuilder for the fileselectbutton setting.

Returns:

PromptBoxBuilder

Returns the current instance of PromptBoxBuilder .

Controls the visibility and configuration of the File Select button in the end affix. When enabled, users can attach files to their prompts.

C#
public PromptBoxBuilder FileSelectButton(bool enabled)
Parameters:enabledbool

Enables or disables the fileselectbutton option.

Returns:

PromptBoxBuilder

Returns the current instance of PromptBoxFileSelectButtonSettingsBuilder .

Defines the fill mode for the PromptBox container.

C#
public PromptBoxBuilder FillMode(FillMode value)
Parameters:valueFillMode

The value for FillMode

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Sets the loading state of the Action button. When true, the button displays a stop icon and allows users to cancel ongoing generation.

C#
public PromptBoxBuilder Loading()
Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Sets the loading state of the Action button. When true, the button displays a stop icon and allows users to cancel ongoing generation.

C#
public PromptBoxBuilder Loading(bool value)
Parameters:valuebool

The value for Loading

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Sets the maximum height of the textarea in pixels. The textarea resizes automatically until it reaches this height. When the content exceeds this height, a scrollbar appears.

C#
public PromptBoxBuilder MaxTextAreaHeight(double value)
Parameters:valuedouble

The value for MaxTextAreaHeight

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Defines the localization messages for the PromptBox.

C#
public PromptBoxBuilder Messages(Action<PromptBoxMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<PromptBoxMessagesSettingsBuilder>

The PromptBoxMessagesSettingsBuilder for the messages setting.

Returns:

PromptBoxBuilder

Returns the current instance of PromptBoxBuilder .

Sets the mode of the PromptBox. Available options are "single", "multi", and "auto". single - Displays a single-line input field; multi - Displays a multi-line textarea with configurable rows or auto - Starts as a single line and expands automatically as the user types.

C#
public PromptBoxBuilder Mode(PromptBoxMode value)
Parameters:valuePromptBoxMode

The value for Mode

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Sets the placeholder text displayed in the PromptBox when it is empty.

C#
public PromptBoxBuilder Placeholder(string value)
Parameters:valuestring

The value for Placeholder

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Sets the read-only state of the PromptBox. When set to true, the PromptBox content cannot be modified but remains accessible.

C#
public PromptBoxBuilder Readonly()
Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Sets the read-only state of the PromptBox. When set to true, the PromptBox content cannot be modified but remains accessible.

C#
public PromptBoxBuilder Readonly(bool value)
Parameters:valuebool

The value for Readonly

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Sets the number of visible text lines in the textarea. Applies only when the mode is set to "multi".

C#
public PromptBoxBuilder Rows(double value)
Parameters:valuedouble

The value for Rows

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Configures the Speech to Text button in the end affix. The button is always visible. When null or not configured, the button is enabled by default. Use { enable: false } to disable it.

C#
public PromptBoxBuilder SpeechToTextButton(Action<PromptBoxSpeechToTextButtonSettingsBuilder> configurator)
Parameters:configuratorAction<PromptBoxSpeechToTextButtonSettingsBuilder>

The PromptBoxSpeechToTextButtonSettingsBuilder for the speechtotextbutton setting.

Returns:

PromptBoxBuilder

Returns the current instance of PromptBoxBuilder .

Configures the Speech to Text button in the end affix. The button is always visible. When null or not configured, the button is enabled by default. Use { enable: false } to disable it.

C#
public PromptBoxBuilder SpeechToTextButton(bool enabled)
Parameters:enabledbool

Enables or disables the speechtotextbutton option.

Returns:

PromptBoxBuilder

Returns the current instance of PromptBoxSpeechToTextButtonSettingsBuilder .

Defines a custom template for the start affix area. The start affix is positioned before the input field.

C#
public PromptBoxBuilder StartAffixTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the startaffixtemplate.

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Defines a custom template for the start affix area. The start affix is positioned before the input field.

C#
public PromptBoxBuilder StartAffixTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for StartAffixTemplate

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Sets the title attribute of the input or textarea element.

C#
public PromptBoxBuilder Title(string value)
Parameters:valuestring

The value for Title

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Defines a custom template for the top affix area. The top affix is positioned at the top of the content area in multi-line mode only.

C#
public PromptBoxBuilder TopAffixTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the topaffixtemplate.

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Defines a custom template for the top affix area. The top affix is positioned at the top of the content area in multi-line mode only.

C#
public PromptBoxBuilder TopAffixTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for TopAffixTemplate

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.

Sets the value of the PromptBox.

C#
public PromptBoxBuilder Value(string value)
Parameters:valuestring

The value for Value

Returns:

PromptBoxBuilder

Returns the current PromptBoxBuilder instance.