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
1730
Ajax causing error for igGrid
posted

Hi,

I am using Asp.Net MVC3 and Infragistics grid.

I have a page with few controls and a search button. On the click of search, I am showing Search results in igGrid.

 

The Ajax Form code is as below:

@using (Ajax.BeginForm("Search", "Search", new AjaxOptions() { HttpMethod = "POST", InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace, OnBegin = "BlockUI", OnComplete = "UnBlockUI", UpdateTargetId = "page" }))

{    

     <div class="div-left">          

              //other controls

            <div><br /><input type="submit" class="ui-button" value="Search" id="searchButton" /> </div>

       </div>

<div class="div-right">   

 @{ if (Model.SearchResults != null && Model.SearchResults.Count > 0)    

       {        @(Html       

                          .Infragistics().Grid<SearchSummary>(Model.SearchResults.AsQueryable()).ID("grid").AutoGenerateColumns(false)       

                         .Columns(col =>        {        col.For(x => x.SummaryName).HeaderText("Run Id");

                                                                   col.For(x => x.Inventory).HeaderText("Inventory");       

                                                                   col.For(x => x.Process).HeaderText("Process");    })

                         .Features(features => { features.Paging().PageSize(50).Type(OpType.Local);

                                                          features.Selection().Mode(SelectionMode.Row).MultipleSelection(false).Activation(true);

                                                          features.Filtering().Mode(FilterMode.Advanced).CaseSensitive(true); features.Sorting(); features.Resizing(); })        

                                                         .Height("700px") .DataBind() .Render() ) }

                      }            

</div>

}

 

When in click on SEARCH, first time the GRID gets loaded with data. But when I hit Search button second time, I get below error:

Microsoft JScript runtime error: Object doesn't support property or method 'igGrid'