We have a ViewData class as follows:
public class QualifierRegistrationViewData
{
public List<QualifierCompany> oQualifierCompany { get; set; }
public List<QualifierNote> QualifierNotes { get; set; }
[DisplayName("Open Permits")]
public string txtOpenPermits { get; set; }
[DisplayName("Expired Permits")]
public string txtExpiredPermits { get; set; }
}
The QualifierNote entity has the following fields/properties:
QualifierNoteID
Note
Description
And this viewData is passed to the View as follows:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
Inherits="System.Web.Mvc.ViewPage<BuildingFrontDesk.ViewData.QualifierRegistrationViewData>" %>
<asp:Content contentPlaceHolderID="MainContent" runat="server">
<%= Html.Telerik().Grid(Model.QualifierNotes)
.Name("Grid")
.Columns(columns =>
{
columns.Add(o => o. QualifierNoteID).Width(100);
columns.Add(o => o. Note).Width(200);
columns.Add(o => o. Description);
})
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
%>
</asp:Content>
We are trying to bind QualifierNotes to the Grid. In the above code, in the columns.Add() we do not have access to the properties of the QualifierNotes entity. How to bind QualifierNotes entity inside strongly typed viewData to the Grid ?
All the samples provided by the documentation do not cover such scenerio.
In our case, the ViewData contains more complicated data structures.