Databound event firing before Datasource.Read

5 posts, 0 answers
  1. Steve
    Steve avatar
    13 posts
    Member since:
    Jun 2013

    Posted 18 Oct 2016 Link to this post

    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 + ")")
                )
            )
    )
  2. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 20 Oct 2016 Link to this post

    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.
  3. Chris
    Chris avatar
    2 posts
    Member since:
    Oct 2016

    Posted 13 Feb 2018 in reply to Kostadin Link to this post

    I would have appreciated it if I could have seen the answer. 
  4. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 15 Feb 2018 Link to this post

    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.
  5. Chris
    Chris avatar
    2 posts
    Member since:
    Oct 2016

    Posted 15 Feb 2018 in reply to Konstantin Dikov Link to this post

    Hi Konstantin,

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

    ...Chris

Back to Top