Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
525
The headerRendered event is never fired for ignite Grid
posted

Hello,

I am using MVC wrapper for building the grid. I am hooking the headerRendered event as follows:

$(gridId).igGrid({
                headerRendered: function (evt, ui) {

                      //my logic goes here...

                }
            });

I am wondering why this event never fires, whats wrong?

Regards,

Arfan Baig

Parents
  • 23953
    Suggested Answer
    Offline posted

    Hello Arfan,

    This is not the correct way to bind to igGrid events when using MVC wrapper.

    When using MVC wrapper you should use jQuery bind/live/delegate/on functions as described in Using Events in IgniteUI topic Bind to events after initialization section.

    Here is an example code:

    <script type="text/javascript">
    $(function () {
    $(document).delegate("#grid1", "iggridheaderrendered", function (evt, ui) {
    //put your code here
    });
    });
    </script>
    @(Html.Infragistics()
    .Grid(Model)
    .ID("grid1")
    .AutoGenerateColumns(false)
    .PrimaryKey("ProductID")
    .Columns(col =>
    {
    col.For(c => c.ProductID).HeaderText("ProductID").DataType("number");
    col.For(c => c.Name).HeaderText("Name");
    col.For(c => c.ProductNumber2).HeaderText("ProductNumber2");
    col.For(c => c.ReleaseDate).HeaderText("ReleaseDate");
    })
    .DataBind()
    .Render())

    Hope this helps,
    Martin Pavlov
    Infragistics, Inc.

Reply Children