Telerik Forums
UI for ASP.NET Core Forum
1 answer
88 views

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

 

 

 

Ivaylo
Telerik team
 answered on 05 Jul 2024
1 answer
96 views

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.

Alexander
Telerik team
 answered on 25 Apr 2023
1 answer
451 views

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.

Aleksandar
Telerik team
 answered on 22 Mar 2022
1 answer
265 views
I have a textarea that displays a specific column's text depending on which row is selected. How can I have this textarea autosize depending on its contents?
Mihaela
Telerik team
 answered on 08 Sep 2021
3 answers
116 views

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

 

Anton Mironov
Telerik team
 answered on 25 Mar 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?