You do not do it like that. You need to create a Model class that aligns the data graph. During the construction of the Model, you can use lazy loading. Either send this model to the view through the controller, or attach it to the larger ViewModel (only model models, not MVVM), which is sent to the view. Then tie it to the grid.
But you will be happier using Ajax loading of the same model as JSON, which I think you are trying to do.
Model
public class ContactModel { public string FName { get; set; } public string LName { get; set; } public string Address { get; set; } public string City { get; set; } public ContactModel() {} public ContactModel(Contact contact)
controller
public JsonResult ReadContacts([DataSourceRequest]DataSourceRequest request) { var contacts = _contactsDataProvider.Read();
But I donβt think that Will ever gets to Philadelphia .;)
source share