or
public
class
CrossReferenceRelationship
{
public
int
Id {
get
;
set
; }
[Display(Name =
"From Partner"
)]
public
string
FromPartner {
get
;
set
; }
[Display(Name =
"To Partner"
)]
public
string
ToPartner {
get
;
set
; }
[Display(Name =
"From Role"
)]
public
string
FromRole {
get
;
set
; }
[Display(Name =
"From Account"
)]
public
string
FromAccount {
get
;
set
; }
[Display(Name =
"To Account"
)]
public
string
ToAccount {
get
;
set
; }
[Display(Name =
"Is Deleted"
)]
public
bool
IsDeleted {
get
;
set
; }
public
ICollection<CrossReferenceRelationshipHistoricEntry> HistoricEntries {
get
;
set
; }
}
public
class
CrossReferenceRelationshipHistoricEntry
{
public
int
Id {
get
;
set
; }
public
int
XrefId {
get
;
set
; }
[Display(Name =
"From Partner"
)]
public
string
FromPartner {
get
;
set
; }
[Display(Name =
"To Partner"
)]
public
string
ToPartner {
get
;
set
; }
[Display(Name =
"From Role"
)]
public
string
FromRole {
get
;
set
; }
[Display(Name =
"From Account"
)]
public
string
FromAccount {
get
;
set
; }
[Display(Name =
"To Account"
)]
public
string
ToAccount {
get
;
set
; }
[Display(Name =
"Action Type"
)]
public
string
ActionType {
get
;
set
; }
[Display(Name =
"Method Used"
)]
public
string
MethodUsed {
get
;
set
; }
[Display(Name =
"Modified By"
)]
public
string
ModifiedBy {
get
;
set
; }
[Display(Name =
"Modified Datetime"
)]
public
DateTime ModifiedDatetime {
get
;
set
; }
}
@(Html.Kendo()
.Grid(Model)
.Name(
"adminGrid"
)
.Columns(columns =>
{
columns.Bound(crr => crr.Id).Filterable(
false
).Width(100);
columns.Bound(crr => crr.FromPartner).Width(200);
columns.Bound(crr => crr.FromAccount).Width(200);
columns.Bound(crr => crr.ToPartner).Width(200);
columns.Bound(crr => crr.ToAccount).Width(150);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(180);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.Scrollable()
.ClientDetailTemplateId(
"HistoricEntries"
)
.Filterable()
.HtmlAttributes(
new
{ style =
"height:430px;"
})
.Events(events => events.DataBound(
"dataBound"
))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Events(events => events.Error(
"error_handler"
))
.Model(model => model.Id(crr => crr.Id))
.Create(update => update.Action(
"Partner_Create"
,
"CrossReferenceRelationship"
))
.Read(read => read.Action(
"Read"
,
"CrossReferenceRelationship"
))
.Update(update => update.Action(
"Update"
,
"CrossReferenceRelationship"
))
.Destroy(update => update.Action(
"Delete"
,
"CrossReferenceRelationship"
))
)
)
<script id=
"HistoricEntries"
type=
"text/kendo-tmpl"
>
@(Html.Kendo().Grid<CrossReferencePortal.Models.CrossReferenceRelationshipHistoricEntry>()
.Name(
"historyGrid_#=Id#"
)
.Columns(columns =>
{
columns.Bound(he => he.FromPartner);
columns.Bound(he => he.FromAccount);
columns.Bound(he => he.ToPartner);
columns.Bound(he => he.ToAccount);
columns.Bound(he => he.FromRole);
columns.Bound(he => he.ActionType);
columns.Bound(he => he.MethodUsed);
columns.Bound(he => he.ModifiedBy);
columns.Bound(he => he.ModifiedDatetime);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(5)
.Read(read => read.Action(
"HistoryRead"
,
"CrossReferenceRelationship"
,
new
{ Id =
"#=Id#"
}))
)
.Pageable()
.Sortable()
.ToClientTemplate()
)
</script>
var grdTmp = grdReport.data("kendoGrid");
grdTmp.destroy();
grdReport.empty();
grdReport.kendoGrid({
dataSource: {
data: vMenuData,
pageSize: 20 //To replace with Header Value
},
dataBound: onMenuDataBound,
reorderable: true,
groupable: true,
sortable: true,
selectable: "row",
filterable: true,
pageable: {
refresh: true,
pageSizes: true
},
columns: vMenuHead,
schema: vMenuSchema
});