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

popup editortemplate dropdownlist selectedindex

0 Answers 105 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 2
Thomas asked on 18 Mar 2014, 02:26 PM
Dear Telerik Team,
I'm actually using a Grid with popup edit and an editor template which contains a dropdownlist that looks like this: 

@(Html.Kendo().DropDownListFor(model => model.Table)
    .OptionLabel(@GeneralConstants.SELECT_VALUE)
    .HtmlAttributes(new { style = "width: 200px", id = "TableDropDown", required = "required" })
    .SelectedIndex(1)
    .Enable(false)
    .AutoBind(true)
    .Name("Table")
    .DataTextField("Name")
    .DataValueField("TableID")
            .Events(e =>
    {
        e.Change("onChange");
        e.DataBound("bound");
    })
    .DataSource(source =>
    {
        source.Read(read =>
        {
            read.Action("GetRegExpressions", "Pattern");
        })
        .ServerFiltering(true);
    })
 
    )

The property Table is an object of type Expressiontable which contains a TableID and a Name. It is disabled, because the value coming out of the database shouldn't be edited.

The thing now is: when the create/update button is clicked the controller doesn't receive the value of the Table property which is delivered as null.
How can I avoid this issue?

Any advice would be helpful.
Thanks in advance and kind regards
Tom 

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Thomas
Top achievements
Rank 2
Share this question
or