This is a migrated thread and some comments may be shown as answers.

How do you change a string's edit box to textarea?

1 Answer 702 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vince
Top achievements
Rank 1
Vince asked on 15 Jan 2019, 06:28 PM

The default Kendo Grid's behavior is to display a text box for string editing. How do you change this to a textarea?

I am trying to use a EditorTemplate but cannot retrieve or pass the model's string values if I use Html.TextArea

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 17 Jan 2019, 12:57 PM
Hi Vince,

Indeed, using a custom editor is the way to go in this scenario. You can use the Html.TextAreaFor helper to be able to bind the textarea to the edited field:
[UIHint("TextArea")]
public string ContactName
{
    get;
    set;
}

Views/Shared/EditorTemplates/TextArea.cshtml
@model string
 
@Html.TextAreaFor(m=>m, new { rows = 3})


Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Vince
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or