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

[Solved] TimePicker whitespace

2 Answers 23 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.
David
Top achievements
Rank 1
David asked on 29 Jun 2011, 04:37 PM
The Timepicker control has a large amount of whitespace around it, even when the popup button is switched off.  I want to place two or more TimePickers side by side and have no white space between them, I'd also like to alter the width of the TimePickers. 

Essentially:

<%= Html.Telerik().TimePicker().Name("t1").ShowButton(false).OpenOnFocus(true) %>
<%= Html.Telerik().TimePicker().Name("t2").ShowButton(false).OpenOnFocus(true) %>
<%= Html.Telerik().TimePicker().Name("t3").ShowButton(false).OpenOnFocus(true) %>

Should appear like:

<input type="text" style="width:50px;" />
<input type="text" style="width:50px;" />
<input type="text" style="width:50px;" />

I'm using MVC2. I've tried messing around with the .t-widget .t-timepicker .t-picker-wrap and .t-input CSS but can't find a way to remove it.

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 30 Jun 2011, 10:35 AM
Hello David,

 
In order to achieve your goal you will need to set width of the input using InputHtmlAttributes like so:

.InputHtmlAttributes( new { style="width:50px"})

If you need to set width to the DIV wrapper you will need to use HtmlAttributes.

Also you will need to modify t-picker-wrap class in order to remove applied padding. Here is a code snippet showing how to achieve this:
#TimePickerID .t-picker-wrap
{
      padding : 0;
}

Best wishes,
Georgi Krustev
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
David
Top achievements
Rank 1
answered on 30 Jun 2011, 11:23 AM
Thanks Georgi, that's perfect.

For anyone interested the final code I'm using in order to have the time drop downs fit correctly is:

        <%= Html.Telerik().TimePicker()
            .Name("t1")
            .ShowButton(false)
            .OpenOnFocus(true)
            .InputHtmlAttributes(new { style = "width:60px" })
            .HtmlAttributes(new { style = "width:65px" })%>        

        <%= Html.Telerik().TimePicker()
            .Name("t2")
            .ShowButton(false)
            .OpenOnFocus(true)
            .InputHtmlAttributes(new { style = "width:60px" })
            .HtmlAttributes(new { style = "width:65px" })%>

        <%= Html.Telerik().TimePicker()
            .Name("t3")
            .ShowButton(false)
            .OpenOnFocus(true)
            .InputHtmlAttributes(new { style = "width:60px" })
            .HtmlAttributes(new { style = "width:65px" })%>
        
Tags
Date/Time Pickers
Asked by
David
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
David
Top achievements
Rank 1
Share this question
or