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

[Solved] Set width

3 Answers 188 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Robert Mullen
Top achievements
Rank 1
Robert Mullen asked on 02 Mar 2010, 09:01 PM
I have tried to set width with

.HtmlAttributes(new { style = "width: 90%;" })

but it appears that this is only set on the top level div. Is there a way to control the width?

3 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 03 Mar 2010, 08:39 AM
Hello Robert,

Unfortunately, there isn't a way to scale the input accordingly without the use of an HTML table and we didn't want to introduce such markup. That said, you can do the following:
  1. add a class to the date picker using .HtmlAttributes(new { @class = "wide-datepicker" })
  2. add a CSS declaration for the given class, .wide-datepicker .t-input { width: 95% }

We have implemented an InputHtmlAttributes method for the fluent interface that will be available with the official release - it will set the width directly on the input.

Regards,
Alex Gyoshev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Robert Mullen
Top achievements
Rank 1
answered on 03 Mar 2010, 01:15 PM
Thanks Alex. This works on the datepicker but I tried the same on the numerictextbox and the spinner arrows get pushed outside the input.
0
Alex Gyoshev
Telerik team
answered on 05 Mar 2010, 07:58 AM
Hello Robert,

In order to get the numeric inputs to get to 90%, you have to set the following:
.t-numerictextbox { width: 90%; }
.t-numerictextbox .t-input { width: 97%; }

Sincerely yours,
Alex Gyoshev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Date/Time Pickers
Asked by
Robert Mullen
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Robert Mullen
Top achievements
Rank 1
Share this question
or