This question is locked. New answers and comments are not allowed.
I've got my grid all setup and bound to my model via ajax but how do I tell it NOT to bind to the data on initial page load?
There are various other things going on in my page and eventually an event fires were I tell the grid to go get its data via the client-side API like so: $("#SitesGrid").data("tGrid").ajaxRequest();
So at the moment the grid is getting the data twice on each page load which is a waste. I want to tell it to NOT get the data on initial load and at the right moment my client-side api call will tell it when its time.
@(Html.Telerik().Grid<SiteModel>()
.Name("SitesGrid")
.Filterable()
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText))
.DataKeys(keys => keys.Add(c => c.SiteId).RouteKey("SiteId"))
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("List", "Site")
.Insert("Insert", "Site")
.Update("Edit", "Site")
.Delete("Delete", "Site"))
.EnableCustomBinding(true)
.Columns(columns =>
{
columns.Command(c =>
{
c.Edit().ButtonType(GridButtonType.Image); ;
c.Delete().ButtonType(GridButtonType.Image); ;
}).Width(50);
columns.Bound(x => x.CustomerId).Hidden();
columns.Bound(x => x.DomainName)
.Width(250)
.Filterable(true);
columns.Bound(x => x.Title)
.Width(250)
.Filterable(true);
columns.Bound(x => x.CreatedOnUtc)
.Width(250)
.Filterable(true);
}))
There are various other things going on in my page and eventually an event fires were I tell the grid to go get its data via the client-side API like so: $("#SitesGrid").data("tGrid").ajaxRequest();
So at the moment the grid is getting the data twice on each page load which is a waste. I want to tell it to NOT get the data on initial load and at the right moment my client-side api call will tell it when its time.
@(Html.Telerik().Grid<SiteModel>()
.Name("SitesGrid")
.Filterable()
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText))
.DataKeys(keys => keys.Add(c => c.SiteId).RouteKey("SiteId"))
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("List", "Site")
.Insert("Insert", "Site")
.Update("Edit", "Site")
.Delete("Delete", "Site"))
.EnableCustomBinding(true)
.Columns(columns =>
{
columns.Command(c =>
{
c.Edit().ButtonType(GridButtonType.Image); ;
c.Delete().ButtonType(GridButtonType.Image); ;
}).Width(50);
columns.Bound(x => x.CustomerId).Hidden();
columns.Bound(x => x.DomainName)
.Width(250)
.Filterable(true);
columns.Bound(x => x.Title)
.Width(250)
.Filterable(true);
columns.Bound(x => x.CreatedOnUtc)
.Width(250)
.Filterable(true);
}))