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

initial Grid field by drop down Editor problem

2 Answers 29 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
iman
Top achievements
Rank 1
iman asked on 05 Aug 2015, 08:28 AM

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 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 07 Aug 2015, 07:19 AM
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
0
iman
Top achievements
Rank 1
answered on 09 Aug 2015, 07:08 AM
thanks......Very much  ..!!!
Tags
DropDownList
Asked by
iman
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
iman
Top achievements
Rank 1
Share this question
or