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

How to set the Width of the input text box

2 Answers 2820 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Denis
Top achievements
Rank 1
Denis asked on 20 Aug 2020, 11:51 AM

We are trying out the Telerik controls and in my scenario I want the width of the AutoComplete input box to be, say 80% of the page.

Now I saw in browser Debug view that there seems to be a hardcoded width of 300px in the elements style? Is that correct?

How can I change that?

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 20 Aug 2020, 12:27 PM

Hi Denis,

While there is a default value for the width (300px), this does not prevent you from setting your own (you may, by the way, find the Dimensions article useful):

 

User input: @TheValue
<br />
<TelerikAutoComplete Data="@Suggestions" @bind-Value="@TheValue" Width="80%"
                     Placeholder="Enter your role (can be free text)" ClearButton="true" />

@code{
    string TheValue { get; set; }

    List<string> Suggestions { get; set; } = new List<string> {
        "Manager", "Developer", "QA", "Technical Writer", "Support Engineer", "Sales Agent", "Architect", "Designer"
    };
}

 

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Denis
Top achievements
Rank 1
answered on 20 Aug 2020, 12:41 PM
Thank you. I must have missed this attribute is available.
Tags
AutoComplete
Asked by
Denis
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Denis
Top achievements
Rank 1
Share this question
or