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
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 PavlovInfragistics, Inc.
Hello Martin,
Thanks for the detailed response.
I have binded the event as you suggested; but, I am still unable to witness the event firing. Am I missing something, can you please create a sample where this event is working correctly?