I have a form split into sections, and within one of the sections I have a TextArea, which I want to render as the full width of the form - even when I suppress the label text, the container and spacing is still rendered and so I lose a chunk of space to the left of the text area (horizantal form layout)
My form code :@(
Html.Kendo().Form<Customer>()
.Name("detailForm")
.HtmlAttributes(new { action = @Url.Action("EditCustomer", "Customer"), method = "POST" })
.Orientation("horizontal")
.Items(items =>
{
items.AddGroup()
.Label("Information")
.Layout("grid")
.Grid(g => g.Cols(2).Gutter(10))
.Items(i =>
{
i.Add()
.Field(f => f.CompanyName)
.Label(l => l.Text("Company Name:").Optional(false));
i.Add()
.Field(f => f.CustomerStatusId)
.Label(l => l.Text("Status:").Optional(false))
.Editor(e =>
{
e.DropDownList()
.HtmlAttributes(new { })
.DataTextField("KeyDescription")
.DataValueField("KeyValue")
.HtmlAttributes(new { style = "width:100%" })
.Size(ComponentSize.Small)
.FillMode(FillMode.Outline)
.DataSource(source =>
{
source.Read(read =>
{
read.Action("LookupValues", "Lookup", new { type = "CustomerStatus" });
})
.ServerFiltering(true);
});
});
});
items.AddGroup()
.Label("Description")
.Items(i =>
{
i.Add()
.Field(f => f.Description)
.Label(l => l.Text(" "))
.Editor(e =>
{
e.TextArea()
.Size(ComponentSize.Small)
.Overflow(TextAreaOverflow.Scroll)
.Rows(8);
});
});
})
)
I have tried using the EditorTemplateHandler but that still seems to render the label section?
Thanks
Hello,
Is there any way to change the <input> attr to <textarea></textarea> in popup?
I have gotten as far as doing some basic jquery removeClass and replaceWith. that seems to do the trick it to show the box,
but not the data.
I know there is an example in how to do it in grid for jquery. But I am trying to see if there is another solution in mvc grid.
Any help is greatly appreciated.
Thank you,
Andi.
Hey guys,
I think it is a bug because the requried validation attribute is not rendered when using tag helper. Can you validate my problem?
Kendo version: 2022.1.119
Model:
[Required(ErrorMessage = "Hey, I am an error message.")]
public string Test { get; set; }
View (working example with html helper):
@Html.Kendo().TextAreaFor(x => x.Test).Rows(3)
View (not working example with tag helper):
<kendo-textarea name="Test" rows="3"></kendo-textarea>
The data-val="true" data-val-required="xxx" attributes are only rendered with html helper.
Hi,
When adding a textarea to a form, I get different html rendered result:
<
kendo-textarea
name
=
"reason-reject"
rows
=
"5"
placeholder
=
"Specify rejection reason"
on-change
=
""
>
</
kendo-textarea
>
@(Html.Kendo().TextArea()
.Name("invitation")
.Placeholder("Enter your text here.")
.Rows(10)
.MaxLength(200)
.HtmlAttributes(new { style = "width: 100%", required = true, data_required_msg = "Please enter a text.", data_max_msg= "Enter value between 1 and 200" })
)
Even using the simple form of widget from the samples, generated invalid html.... Can you provide any guidance ?
Is is possible with taghelper, mark the control as mandatory ?
Any help will be highly appreciated,
Manuel