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

Refresh DropDownList İnside Kendo Grid

3 Answers 557 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ömer
Top achievements
Rank 1
Ömer asked on 24 Jun 2014, 03:33 PM
Hello,

I use dropdownlist as an editortemplate for my Kendo Grid like this:

columns.Bound(c => c.Test.Text).Width("5%").EditorTemplateName("Test").EditorViewData(new { data= ViewData["data"] }); 

and this is my dropdownlist that is in the editortemplates folder:

@(Html.Kendo().DropDownList()
      .Name("Test")
           .DataTextField("Text")
           .DataValueField("Text")
           .AutoBind(true)
           .DataSource(c =>
               {
                   c.Read(k => k.Action("GetMethod", "Controller", new { data = ViewData["data"] }));
               })
)

that works fine. However, there is a problem about refreshing datasource of this dropdownlist. Because i can not find any way to access dropdownlist and refreshing its datasource. How can i do this?, how can i trigger read action of dropdownlist?

            


3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 26 Jun 2014, 02:05 PM
Hi,

From the provided information it's not clear for us what is the exact scenario that you have, however you can use the "Edit" event of the Grid (for example) to access the DropDownList by it's "id" attribute and refresh it's DataSource. Please consider the following example:

function onEdit(e) {
    var dropDownList = e.container.find("#Test").data("kendoDropDownList");
    //or e.container.find("[name=Test]").data("kendoDropDownList")
    dropDownList.dataSource.read();
}

Regards,
Vladimir Iliev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Raymond E
Top achievements
Rank 1
answered on 26 Jun 2014, 04:35 PM
I wanted to see if it was possible to only reload the rows that were updated instead of reloading all of the rows in the grid. I'm passing back the rows that were updated from the controller.
0
Vladimir Iliev
Telerik team
answered on 27 Jun 2014, 05:24 AM
Hi,

Refreshing only the DataSource of the DropDownLists for already updated records is not supported out of the box and it's up to the developer to implement this feature (for example saving the updated rows IDs to global variable which to be used inside the "Edit" event of the Grid).

Regards,
Vladimir Iliev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Ömer
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Raymond E
Top achievements
Rank 1
Share this question
or