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

Grid with popup edit and dropdown

3 Answers 189 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Drew Auman
Top achievements
Rank 1
Drew Auman asked on 21 Feb 2013, 11:39 PM
Hello,
here's the part of the code from the template...
@(Html.Kendo().DropDownListFor(model => model.EmailType)
          .Name("EmailType")
          .BindTo(Enum.GetNames(typeof (EmailTypeEnum)).ToList())
                 )

When the popup is shown from an edit command, the value that is selected does not show in the grid after I click "Update". I can see the orange indicator that the fields is being edited in the grid, but the value is not shown.
If I do need to use a datasource object, can I use emuns as the underlying data type? If so please show an example.

Thanks

 

 

 

 

 

 

)

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 25 Feb 2013, 12:01 PM
Hello Drew,

Recently we created a code library project which shows how to use Enumerations with Ajax editable Grid.

http://www.kendoui.com/code-library/mvc/grid/ajax-editing-with-enumerations.aspx

I hope this helps.

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Drew Auman
Top achievements
Rank 1
answered on 25 Feb 2013, 01:26 PM
Thanks for the response. The solution I'm developing requires a popup and not using batch editing (In grid editing). Are there any samples with this type of implementation?
0
Petur Subev
Telerik team
answered on 27 Feb 2013, 11:48 AM
Hello Drew,

Basically there should not be any difference. What exactly did you tried? I changed to code from the code library index view to the following and it seems to be working fine:

@{
    ViewBag.Title = "Index";
}
 
<h2>Index</h2>
 
@(Html.Kendo().Grid<EnumerationEditing.Models.Product>()
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.ID);
        columns.Bound(p => p.Name);
        columns.Bound(p => p.Category);
        columns.Command(p => p.Edit());
    })
    //.ToolBar(toolbar =>
    //{
    //    toolbar.Create();
    //    toolbar.Save();
    //})
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
    .Pageable()
    .Sortable()
    .Filterable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Batch(true)
        .ServerOperation(false)
        .Model(model =>
            {
                model.Id(p => p.ID);
                model.Field(p => p.ID).Editable(false);
            })
        .Read("Read", "Home")
        .Create("Create", "Home")
        .Update("Update", "Home")
    )
)

Let me know if further questions arise.

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Drew Auman
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Drew Auman
Top achievements
Rank 1
Share this question
or