initial Grid field by drop down Editor problem

3 posts, 1 answers
  1. iman
    iman avatar
    2 posts
    Member since:
    Jul 2015

    Posted 05 Aug 2015 Link to this post

    I have a Kendo grid with drop down lists  and its prefectly working but a one problem....

    my grid field Values doesn't change to drop down list new "selected index"..

    my Kendo Grid:

    @(Html.Kendo().Grid<marsyeh.Models.MarsyehGridVM>()
            .Name("3-Grid")
            .Columns(columns =>
            {
                columns.Bound(C => C.id).Hidden(true);
                columns.Bound(C => C.Maddah).ClientTemplate("#=Maddah.Name#");
                columns.Bound(C => C.Massum).ClientTemplate("#=Massum.Name#");
                columns.Bound(C => C.Tem).ClientTemplate("#=Tem.Name#");
                columns.Bound(C => C.Event).ClientTemplate("#=Event.Name#");

                columns.Command(C => { C.Destroy().Text("حذف"); }).Width(200);
            })
            .ToolBar(toolbar =>
            {
                toolbar.Save();
            })
            .Filterable()
            .Editable(editable => editable.Mode(GridEditMode.InCell))
            .Pageable()
            .Groupable(g => g.Messages(M => M.Empty("برای گروه بندی؛ عنوان ستون مورد نظر را به اینجا Drag کنید ")))
            .Navigatable()
            .Sortable()
            .Reorderable(re => re.Columns(true))
            .DataSource(dataSource => dataSource
                .Ajax()
               .Batch(true)
                .ServerOperation(true)
                .PageSize(10)
                .Events(events => events.Error("error_handler"))
                    .Model(model =>
                    {
                        model.Id(p => p.id);
                       
                    })
                    .Read(read => read.Action("SeeMarsyeh2", "Marsyehs"))
                .Update("EditByGrid", "Marsyehs")
                .Destroy("DeleteByGrid", "Marsyehs")

            )
    )

    ********

    and one of My Drop Down Editor :

    @model marsyeh.Models._Tem
    @(Html.Kendo().DropDownList().Name("Tem2DropDown")
    .DataTextField("Name")
    .DataValueField("id")
    .DataSource(D => D
        .Read(Read => Read.Action("ForDropDownList", "Tems"))
    )
    )

    And I Used "  [UIHint("Tem2DropDown")]" in model to relating column with Editor and it worked ...

     

  2. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 07 Aug 2015 Link to this post

    Hello iman,

    In general, the widget's name should point to the model field. That being said, the widget should be named after the specific model field. If the model field is "Event", then the name of the widget should be also "Event". This will ensure that the widget updates the correct model field on change.

    I would suggest you review our "Editing custom editor" demo for more details. If you would like to review the full implementation, please refer to the offline demos part of the UI for ASP.NET MVC bundle. You can find them in the installation folder of the components.

    Regards,
    Georgi Krustev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. iman
    iman avatar
    2 posts
    Member since:
    Jul 2015

    Posted 09 Aug 2015 in reply to Georgi Krustev Link to this post

    thanks......Very much  ..!!!
Back to Top