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

onChange event not found with dynamic model

1 Answer 298 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Danny
Top achievements
Rank 1
Iron
Veteran
Iron
Danny asked on 26 Oct 2020, 09:10 PM

Greetings Telerik

I have the following Grid which I fill from a DataTable, everything works fine but when I add .Events (events => events .Change ("onChange")) it doesn't load anything, could you please help me, thank you very much in advance.

 

@model System.Data.DataTable

@(Html.Kendo().Grid<dynamic>
          ()
          .Name("rgvListado")
          .HtmlAttributes(new { style = "height: 650px;" })
          .Scrollable()
          .ToolBar(t => t.Search())
          .Columns(columns =>
          {
            foreach (System.Data.DataColumn column in Model.Columns)
            {
              var c = columns.Bound(column.ColumnName);
            }
          })
          .Sortable()
          .Groupable()
          .Selectable(selectable => selectable
            .Mode(GridSelectionMode.Single)
            .Type(GridSelectionType.Row))
          .DataSource(dataSource => dataSource
            .Ajax()
            .Model(model =>
            {
              foreach (System.Data.DataColumn column in Model.Columns)
              {
                var field = model.Field(column.ColumnName, column.DataType);
              }
            })
            .Read(read => read.Action("ReadTable", "General"))
            .ServerOperation(false)
          )
          .Events(events => events
            .Change("onChange"))
          )

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 28 Oct 2020, 04:24 PM

Hello Danny,

 

Thank you for the provided video - it gives a nice overview of the case.

The issue is probably related to a javascript error within the onChange(arg) function. Try to open the web site on Chrome with the F12 inspector open and check whether there are any script errors.

 

Regards,
Eyup
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Danny
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Eyup
Telerik team
Share this question
or