Hi Stephen,
To update the Grid datasource, you have to use the Grid dataSource method. In the click event of the Button, we have repopulated Grid data using the dataSource method. Refer to the following code example and Help Document.
@Html.EJ().Button("btn").Text("Render Data").ClientSideEvents(e => e.Click("onClick"))
@(Html.EJ().Grid<object>("FlatGrid")
.AllowPaging()
. .
..
)
<script>
function onClick(args) {
var dataManager = ej.DataManager({
url: "/api/Values/",
adaptor: new ej.WebApiAdaptor()
});
var query = new ej.Query().take(10);
var promise = dataManager.executeQuery(query);
promise.done(function (e) {
var gridObj = $("#FlatGrid").ejGrid("instance");
gridObj.dataSource(e.result.result)
});
}
</script> |
We have prepared a sample that can be downloaded from the following location.
Regards,
Seeni Sakthi Kumar S.