I put together a page and model without the extra project details, just to make sure it wasn't something else on the page or something else about the controller (or something my client would not want posted in a forum).
Hello Daniel,
Thank you for contacting Infragistics!
It seems your error image did not attach properly to the forum thread. Can you please reattach it in a zip file?
Sorry about that, the file should be attached to this reply.
Thanks,
Daniel Replogle
Thank you for the update. I believe the reason you are getting this error is you are changing the type of the datasource on the update and the grid isn’t setup properly to take that type. Instead, I recommend you use the datasourceurl of the grid and just call databind on your button click. Your grid will look like the following:
@(Html.Infragistics()
.Grid<igGrid_MVC5.Models.SampleItem>()
.ID("igGrid")
.Width("600px")
.Height("600px")
.AutoGenerateColumns(false)
.DataSourceUrl("/Home/UpdateGrid/")
.Columns(column =>
{
column.For(x => x.ID).HeaderText("ID");
column.For(x => x.FirstValue).HeaderText("FirstValue");
column.For(x => x.SecondValue).HeaderText("SecondValue");
})
.DataBind()
.Render())
Your JavaScript function:
function otherUpdateGrid() {
var grid = $("#igGrid");
grid.igGrid("dataBind");
}
The method that returns the data in your controller:
[GridDataSourceAction]
public ActionResult UpdateGrid()
var model = new List<SampleItem>
new SampleItem { ID = 6, FirstValue = "FF", SecondValue = "ff" },
new SampleItem { ID = 7, FirstValue = "GG", SecondValue = "gg" },
new SampleItem { ID = 8, FirstValue = "HH", SecondValue = "hh" },
new SampleItem { ID = 9, FirstValue = "II", SecondValue = "ii" },
new SampleItem { ID = 10, FirstValue = "JJ", SecondValue = "jj" }
};
return View(model.AsQueryable());
Then your index would just look like this:
public ActionResult Index()
return View();
Okay, that makes sense.
Thank you,