Kendo Grid - how to add a TextArea for Inline Editing

1 Answer 774 Views
Grid
Bermuda
Top achievements
Rank 1
Iron
Iron
Bermuda asked on 10 Jul 2023, 04:37 PM

Hello,

 

I am new to Kendo grid.  I would like to add a textarea for inline editing of a grid field.  Currently in edit mode there is a text box and I want to replace this with a multi line textarea.  My grid is using Ajax.

thanks.

1 Answer, 1 is accepted

Sort by
0
Bermuda
Top achievements
Rank 1
Iron
Iron
answered on 10 Jul 2023, 07:28 PM

Hi I solved by:

Creating EditorTemplate TextArea.cshtml in Shared/EditorTemplates

@model string
 

@Html.TextAreaFor(m=>m, new { rows = 5, @style = "color:red", cols="35"})

 

Referenced in grid

columns.Bound(p => p.Comments).Title("Comments").Width(300).EditorTemplateName("TextArea");

Mihaela
Telerik team
commented on 13 Jul 2023, 08:17 AM | edited

Another option is to define Telerik UI for ASP.NET Core TextArea editor into the "TextArea" editor template:

@model string
 
@(Html.Kendo().TextAreaFor(m => m)
  .Rows(5)
  .Cols(35)
  .HtmlAttributes(new { style = "color: red;" })
)

Tags
Grid
Asked by
Bermuda
Top achievements
Rank 1
Iron
Iron
Answers by
Bermuda
Top achievements
Rank 1
Iron
Iron
Share this question
or