Hiii,
Could you please help me for bind dropdown list to kendo grid.. in my case functionalities are working fine.. But there is no display for the selected item in kendo grid when loaded... After edit button click the dropdown becom visible..
@(Html.Kendo().Grid(iTeamMvcKendo.Nexgen.iTeam.Library.TimeTracker.GetDaywisePunchesList(Convert.ToInt32(ViewData["UserID"]), Convert.ToDateTime(ViewData["PunchDate"])))
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.InTime)
.HeaderHtmlAttributes(new { Style = "width:15%" })
.Title("In Time")
.Format("{0:hh:mmtt}")
.EditorTemplateName("DateTime")
.Width("15%");
columns.Bound(p => p.OutTime)
.HeaderHtmlAttributes(new { Style = "width:15%" })
.Title("Out Time")
.Format("{0:hh:mmtt}")
.EditorTemplateName("DateTime")
.Width("15%");
columns.Bound(p => p.TotalHours).HeaderHtmlAttributes(new { Style = "width:15%" })
.Title("Total Hours");
columns.ForeignKey(p => p.ReasonID, (System.Collections.IEnumerable)ViewData["Reason"],dataFieldText: "ReasonName", dataFieldValue: "ReasonID" )
.HeaderHtmlAttributes(new { Style = "width:15%" })
.Title("Punch Out Reason").Width(160);
columns.Bound(p => p.BreakHours)
.HeaderHtmlAttributes(new { Style = "width:15%" })
.Title("Break Hours");
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(172);
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:430px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Events(events => events.Error("error_handler"))
.Model(model =>
{
model.Id(p => p.TimeTrackerID);
model.Field(p => p.ReasonID).DefaultValue(103);
})
.Read(read => read.Action("UselogRead", "UserLog"))
.Update(update => update.Action("SaveUserLog", "UserLog"))
.Destroy(update => update.Action("DeleteUserLog", "UserLog"))
)
)