I'm using igGrid in the MVC3.
When the igGrid load first time the groupby works fine.
But after I call $("#igGrid").igGrid("dataBind"); groupby didn't work anymore after DataBind.
I have to setting some filters, and bind the data which base on the filters to the grid. (So I have to rebind data source)
Is there anything wrong with the code, or what else should I do?
Code as follow:
@( Html.Infragistics().Grid<MyModel>().ID("igGrid") .AutoGenerateColumns(true).PrimaryKey("ID") .Columns(column => { column.For(x => x.ID).DataType("string").HeaderText("ID").Width("150px"); }) .Features(features => { features.Resizing(); features.Selection().MultipleSelection(true); features.Sorting().Type(OpType.Local); features.GroupBy().Type(OpType.Local); features.Paging().PageSize(100); }) .DataSourceUrl(Url.Action("RequestMyData", "MyControl")) .Width("100%") .Height("100%") .DataBind() .Render() )
function refreshData() { $("#igGrid").igGrid("dataBind");}
Control:
[GridDataSourceAction] [ActionName("RequestMyData")] public ActionResult RequestMyData() { IQueryable<MyData> datas= DB.GetMyDats(filters); return View(datas); }
More information: I also test on the Infragistics.Web.Mvc.Samples Grid API.
After rebinding data, groupby didn't work anymore (Can't choose groupby column by mouse drag)
hi,
the fact that groupby drag and drop functionality is lost after rebinding is a bug and i have informed our engineers to submit it.
As for the actual rebinding, since it's remote, but the grid sends its first batch of data inline along with the rest of the page (in order to avoid making 2 roundtrips), you need to reset the data source type to remoteUrl, so that the grid makes the request when you do dataBind:
$("#grid1").igGrid("option", "dataSourceType", "remoteUrl");
// call dataBind here.
Hope it helps. You can contact DS regarding the status of the bug i've mentioned. Thanks,
Angel
I have the same problem but with the different feature. My filtering is not working after $("#grid1").igGrid("dataBind");. I place your code but didn't work. Can you give me any suggestion?