I have Grid View which I'm using with a remote data source but initially populating with local data. Basically the same requirement as the following
http://www.kendoui.com/forums/kendo-ui-web/grid/initial-load-locally-with-remote-datasource.aspx except that I'm using .NET MVC extensions.
Its essentially working as a normal remotely loaded grid view but I'm also passing data with a view model on the initial page load.
This seems to work fine (at least with a smallish data set) however I can't find any other examples of anyone doing this which makes me wonder if I'm being stupid and there is a reason I shouldn't do this? Is the fact the I'm using 2 data set likely to cause issues that I've not yet discovered? Would the fact I'm not passing my data DataSourceResult in Index() mean I bring more data to the server than I need to? The data set for this isn't big, but it's being pulled together from various sources so it is quite slow, so speed is a big consideration for me.
My Grid view is as follows
Controller is below where the view is loaded via ActionIndex
http://www.kendoui.com/forums/kendo-ui-web/grid/initial-load-locally-with-remote-datasource.aspx except that I'm using .NET MVC extensions.
Its essentially working as a normal remotely loaded grid view but I'm also passing data with a view model on the initial page load.
This seems to work fine (at least with a smallish data set) however I can't find any other examples of anyone doing this which makes me wonder if I'm being stupid and there is a reason I shouldn't do this? Is the fact the I'm using 2 data set likely to cause issues that I've not yet discovered? Would the fact I'm not passing my data DataSourceResult in Index() mean I bring more data to the server than I need to? The data set for this isn't big, but it's being pulled together from various sources so it is quite slow, so speed is a big consideration for me.
My Grid view is as follows
@model IEnumerable<MVCCOD.ViewModels.ProviderDisputeViewModel>
@(Html.Kendo().Grid(Model).Name(
"Disputes"
).Columns(c => {
c.Bound(p => p.ID);
c.Bound(p => p.BillingPrvName);
/* etc */
}
).
DataSource(d => d
.Ajax()
.Read(r => r.Action(
"JsonRead"
,
"ProviderDispute"
)).PageSize(50)
).
Pageable().
Sortable())
public
class
ProviderDisputeController : Controller
{
public
ActionResult Index()
{
return
View(GetDisputes());
}
public
ActionResult JsonRead([DataSourceRequest] DataSourceRequest request)
{
return
Json(GetDisputes().ToDataSourceResult(request));
}
private
List<ProviderDisputeViewModel> GetDisputes()
{
/* etc */
}
}