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

Databound event firing before Datasource.Read

4 Answers 561 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 18 Oct 2016, 04:49 PM

I understand the Databound event for the MVC grid is supposed to fire after the grid is fully rendered. But I'm seeing the databound event fires, then my read action fires, after which the databound event doesn't fire again. Below is my code for the grid. Anyone have an idea of what I'm doing wrong? Thanks in advance.

 

@(Html.Kendo().Grid<dynamic>()
            .Name("StandardTable_" + Model.InstanceKey)
            .Resizable(resize => resize.Columns(true))
            .Pageable(pageable => pageable
                .Input(true)
                .Refresh(true)
                .PageSizes(true)
                .ButtonCount(5)
                .Enabled(true)
                .Numeric(false)
            ).ColumnMenu()
            .Sortable(s => s.SortMode(GridSortMode.MultipleColumn).AllowUnsort(true))
            .Filterable()
            .Groupable()
            .Reorderable(reorder => reorder.Columns(true))
            .Scrollable(e => e.Enabled(true).Virtual(true).Height("auto"))
            .EnableCustomBinding(true)
        .Events(e => e
            .DataBound("pan.dashboardsetup.gridDatabound(" + Model.dashFeed?.FeedKey + "," + Model.InstanceKey + ")")
            .ColumnMenuInit("pan.dashDatapart.menuInit")
            )
        .DataSource(d => d
            .Ajax()
            .PageSize(pageSize)
            .Read(read => read
                .Action("StandardTableRead", "Feeds").Data("pan.dashDatapart.StandardGridRead(" + Model.dashFeed?.FeedKey + "," + Model.InstanceKey + ")")
            )
        )
)

4 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 20 Oct 2016, 08:49 AM
Hello Steve,

I already answered your question in the support ticket you have opened with the same requirement. I would appreciate if we continue our conversation there.

Regards,
Kostadin
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
0
Chris
Top achievements
Rank 1
answered on 13 Feb 2018, 05:32 PM
I would have appreciated it if I could have seen the answer. 
0
Konstantin Dikov
Telerik team
answered on 15 Feb 2018, 12:51 PM
Hi Chris,

The issue with this code is within the Data function of the read, which should be a pointer to the function: Data("myHandler"). Defining this as Data("myHandler()") will execute the function along with the initialization of the Grid.

When additional data must be passed, the following syntax should be used:
.Data("function(){ myHandler()}")

Hope this helps.


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Chris
Top achievements
Rank 1
answered on 15 Feb 2018, 04:02 PM

Hi Konstantin,

Yes, that does help. Thank you for following up.

...Chris

Tags
Grid
Asked by
Steve
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Chris
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or