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

Kendo UI ASP.NET MVC Html.EditorFor() with styling problem

1 Answer 364 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Demian
Top achievements
Rank 1
Demian asked on 19 Sep 2013, 11:49 AM
Hi,

I use Kendo UI ASP.NET MVC with VB.NET. My question is:
How I can define the width for the @Html.EditorFor() width css?


SampleView.vbhtml
        <td class="editor-field">
            @Html.EditorFor(Function(model) model.Tel1)        
            @Html.ValidationMessageFor(Function(model) model.Tel1)
        </td>

I tried to define a css style like this:


Site.css

#small-editfor
{
width:30px;
border-bottom-left-radius:0px;
border-bottom-right-radius:0px;
border-top-left-radius:0px;
border-top-right-radius:0px;
}

SampleView.vbhtml
        <td class="editor-field">
            @Html.EditorFor(Function(model) model.Tel1,Nothing, "small-editfor",Nothing)
            @Html.ValidationMessageFor(Function(model) model.Tel1)
        </td>

With this solution I see the width
30px, but the value of the property Tel1 would’t be available on the server.

I tried this also without success:

SampleView.vbhtml
        <td class="editor-field">
            @Html.EditorFor(Function(model) model.Tel1 New With { .class=”small-editfor”})
            @Html.ValidationMessageFor(Function(model) model.Tel1)
        </td>

        <td class="editor-field">
            @Html.EditorFor(Function(model) model.Tel1 New With { .style=”width:30px”})  
            @Html.ValidationMessageFor(Function(model) model.Tel1)
        </td>

Does anyone have an idea?

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 20 Sep 2013, 07:02 AM
Hi Demian,

I am not sure how is your scenario and question related to Kendo UI. Please clarify.

In case you are trying to override or customize the default styling inside a Grid edit form, please make sure that you are using correct selectors with high-enough specificity. Using a web developer tool (e.g. Firebug) will help you greatly in this task.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Demian
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or