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
275
GroupBy didn't work after DataBind
posted

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);
        }