Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Read-only grid bound to child collection in my view model

$
0
0

Hi there,

I'm sure there's an easy way to do this but I can't seem to figure it out from the various examples I've seen using the Kendo Grid.  I have a view which has a model, and I want a grid to appear on the page populated from a collection that is a child property in my model.  The grid is 100% read-only for display only, and doesn't need any server side binding.  It also doesn't need paging, but client side sorting would be helpful.  Here is my model :-

public class RegisterViewModel
    {
        public int RegisterID { get; set; }
        public string BuildingDesignation { get; set; }
        public string BuildingDescription { get; set; }
        public string AgeOfBuilding { get; set; }
        public string ConstructionType { get; set; }
        public int? PhotoID { get; set; }
        public List<Sample> Samples { get; set; }
        public string EmployeeName { get; set; }
    }

The property I want to generate the grid from is Samples.  The other properties are just normal properties I put into a form on the page.

Any help of how to accomplish this would be appreciated.  As it stands, the only way I can think to achieve this is to loop through the collection and draw out a HTML table row by row, but I'd like if possible to keep it as a Kendo grid in line with other gris in my application.

Many thanks, Mark


Viewing all articles
Browse latest Browse all 94857

Trending Articles