CurrencyTextBoxFor Read only issue

4 posts, 0 answers
  1. PAUL
    PAUL avatar
    36 posts
    Member since:
    Aug 2012

    Posted 29 Aug 2012 Link to this post

    Seems so simple. Would like to find a quick solution but never can. I have a autocomplete set to read only... no problem.

    @Html.Kendo().AutoCompleteFor(model => model.CID).Name("CID").HtmlAttributes(new { @readonly = "readonly" })

    Now I want to make CurrencyTextBoxFor read only. PROBLEM. Why is every widget different on basic attributes? Here is the code:

    @Html.Kendo().CurrencyTextBoxFor(model => model.BudgetSpent).Name("BudgetSpent").HtmlAttributes(new { @readonly = "readonly" })

    It doesn't work. Can't find it in documentation and have to move on to the next Kendo problem for MVC

    Please help or point me to where I can find a solution to basic features like this.

    Thanks
  2. PAUL
    PAUL avatar
    36 posts
    Member since:
    Aug 2012

    Posted 29 Aug 2012 Link to this post

    and after further investigation

    @Html.Kendo().CurrencyTextBoxFor(model => model.AvailableBudget).Name(

     

    "AvailableBudget").Spinners(false).HtmlAttributes(new { @readonly = "readonly" })


    The text box itself is set to read only but the widget overlay is a separate issue...

     

  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 30 Aug 2012 Link to this post

    Hello PAUL,

     
    Could you please elaborate more on the "but the widget overlay is a separate issue...". What is the required behavior? After you make the input readonly, it can be focused, but not modified.

    Regards,
    Georgi Krustev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. PAUL
    PAUL avatar
    36 posts
    Member since:
    Aug 2012

    Posted 30 Aug 2012 Link to this post

    The required behavior is for the display to be read only. The problem is that there is a spinner on the number textboxes (which is a separate object) that can increment the display. So even though you could not type into the text box you could still click the up or down arrow and that would change the value in the textbox....therefore not read only.

    The default value for the Spinners is true so setting it to false removed them and problem solved...

    Sorry new to Kendo and just trying to get around...

    Thanks

Back to Top
UI for ASP.NET MVC is VS 2017 Ready