This is a migrated thread and some comments may be shown as answers.
How do
1 Answer 98 Views
This is a migrated thread and some comments may be shown as answers.
Sean Cross
Top achievements
Rank 1
Sean Cross asked on 29 Nov 2012, 09:09 AM
avatar
I want to set the  width of a currency text box.  I am using the legacy WebBlue theme.

I have tried
<%: Html.Kendo().CurrencyTextBoxFor(x => x.Charged).HtmlAttributes(new { style = "width:100px" }) %>

but that just cuts off the right hand edge.

I have tried the approach in
http://www.kendoui.com/forums/mvc/numeric-textbox/set-width-on-client-side.aspx
 but that doesn't work either.

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 03 Dec 2012, 09:38 AM
Hi Sean,


Basically if you are using the Legacy themes you should additionally set the width of the input element using jQuery on document ready. Please check the example below:

@(Html.Kendo().CurrencyTextBoxFor(m => m.Charged).HtmlAttributes(new { style = "width: 300px"} ))
 
 
<script>   
    $(function () {
        $("#Charged").prev().width($("#Charged").closest(".k-numerictextbox").width());
    })
</script>
Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Asked by
Sean Cross
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or