I am new to MVC and really new to using the Telerik tools. I have a grid made in my HTML and the headers come up and no data. I would like to get the data to show up in the Grid. I am sure I need to add something to the controller, just do not know what. I have looked all over and I am getting information overload. Here is what I have in my grid, what do I need in my controller?:
@(Html.Kendo().Grid<CertificateTrackingSystem.Models.Status>
()
.Name("StatusGrid")
.Columns(columns =>
{
columns.Bound(c => c.statusID)
.Visible(false).IncludeInMenu(true)
.Title("ID").Width(30);
columns.Bound(c => c.NameofStatus)
.Title("Status Name").Width(70);
//columns.Command(commands =>
//{
// commands.Edit().Text(" ".).UpdateText(" ").CancelText(" ");
// commands.Destroy().Text(" ");
//}).Title("Actions").Width(150);
}
)
.Filterable(ftb => ftb.Mode(GridFilterMode.Menu))
.DataSource(dataSource =>
dataSource.Ajax()
.Sort(sort => sort.Add("Status").Descending())
.Model(model =>
{
model.Id(Status => Status.statusID);
model.Field(Status => Status.NameofStatus).Editable(false);
}
)
)//.Events(e => e.sync("sync_handler"))
// .Create(create => create.Action("AddComments", "Document", new { areas = "Document", docID = @documentID, docRev = @documentRev }).Data("GetRequestToken"))
// .Read(read => read.Action("ReadComments", "Document", new { areas = "Document", documentID = @documentID, documentRev = @documentRev }).Type(HttpVerbs.Get))
// .Update(update => update.Action("UpdateComments", "Document",new { areas = "Document" }).Data("GetRequestToken"))
// .Destroy(destroy => destroy.Action("DeleteComments", "Document", new { areas = "Document"}).Data("GetRequestToken"))
// .PageSize(5)
// .ServerOperation(false)//.Pageable(x => x.PageSizes(new List<object> { 5, 10, 20, 50, "all" }).Refresh(true))
//.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("Comments"))
//.Sortable()
)
8 Answers, 1 is accepted
Hello Christine,
I would suggest you read the following Ajax binding article. It demonstrates step by step how to configure the Grid HtmlHelper extension for Ajax binding.
Additionally, I am attaching a small MVC demo project implementing a Grid that supports editing, filtering, sorting functionalities. There you can find how the CRUD operations are configured. Please examine it and let me know if you have any questions.
Regards,
Nikolay
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.


OK sorry if I sound frustrated here but it has been a long day. I have three Grids that are acting great. One grid I have set up has about 15 fields and is scrolling off the page. It looks like the area data is displayed is not as big as the headers, Could that be a reason that the data is not displaying? I have it set up like the other grids that are displaying data. I have included a picture and you can see the headers are off the page but what looks to be a table that will hold the data is not as big as the headers.
I will take a look at your application you zipped up and maybe it will help with other things down the road.

The demo really helped me get started on the CRUD operations. I have one grid completely done for one of my screens and it looks good. The one thing I am wondering is when you want to do a search, is there a to put something like a little icon that a person see and click on to show the search screen. I did not really know where to click until I played with it some.
Also my main Grid is still having issues. The header shows up but still no data is displaying. I even went and deleted the grid and recreated it with no luck. So I do not know what I need to do to get the data to show, it really has me scratching me head.
Hello Christine,
By saying "do a search" are you referring to the Search Panel functionality or the Filter one? Both of them have icons suggesting to the user that they can search or filter.
Regarding the Grid data not showing, it is hard to tell what might be causing this behavior without having the Grid declaration. Are there any JavaScript errors in the console? Is the data returned correctly for the controller (read method)? This can be found in the Network tab in DevTools:
Looking forward to your reply.
Regards,
Nikolay
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.


