Grid with popup edit and dropdown

4 posts, 0 answers
  1. Drew Auman
    Drew Auman avatar
    17 posts
    Member since:
    Sep 2009

    Posted 21 Feb 2013 Link to this post

    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

     

     

     

     

     

     

    )

  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 25 Feb 2013 Link to this post

    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!
  3. Drew Auman
    Drew Auman avatar
    17 posts
    Member since:
    Sep 2009

    Posted 25 Feb 2013 Link to this post

    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?
  4. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 27 Feb 2013 Link to this post

    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!
Back to Top