Hi All,
I am stuck with a very small problem. Please help me in solution to the problem.
Basically, I need to compare the value in the BatchingStatus field in my dataset accordingly need to disable the checkbox in the grid.
Following is my code. Attached the screen shot of portal.
@using (Html.BeginForm("ReplaySelectedMessages", "Home"))
{
<div id="gridContent">
<h1></h1>
@(Html.Kendo().Grid<XYZ.MessageReplay.MvcApp.Models.LogModel>(Model)
.Name("gridTable")
//.EnableCustomBinding(true)
.HtmlAttributes(new {style = "font-family: verdana,arial,sans-serif; font-size: 11px;color: #333333;border-color: #999999;"})
.Columns(columns =>
{
columns.Template(@<text>#if(@item.BatchingStatus) == 0 { # <input class='box' id='assignChkBx' name='assignChkBx' type='checkbox' value='@item.LogID' /> #} else {# <input class='box' id='assignChkBx' name='assignChkBx' type='checkbox' value='@item.LogID' disabled='disabled'/> #} # </text>).HeaderTemplate(@<text><input class="selectAll" type="checkbox" id="allBox" onclick="toggleSelection()"/></text>).Width(20);
columns.Bound(p => p.LogID).Template(p => Html.ActionLink(((string)p.LogID), "MessageDetails", new { logid = p.LogID })).Width(200);
columns.Bound(p => p.ReceivePortName)
.Width(100)
.Filterable(ft => ft.UI("ReceivePortsFilter").Extra(false));
columns.Bound(p => p.SendPortName).Width(100).Filterable(ft => ft.UI("SendPortsFilter").Extra(false));
columns.Bound(p => p.loggedDate).Format("{0:MM/dd/yyyy hh:mm tt}").Filterable(f => f.UI("DateTimeFilter").Extra(true)).Width(100);
columns.Bound(p => p.ControlID).Width(100).Filterable(e => e.Extra(false));
columns.Bound(p => p.SenderID).Width(100).Filterable(ft => ft.UI("SenderIDFilter").Extra(false));
columns.Bound(p => p.ReceiverID).Width(100).Filterable(ft => ft.UI("ReceiverIDFilter").Extra(false));
columns.Bound(p => p.InterchangeID).Width(100).Filterable(e => e.Extra(false));
columns.Bound(p => p.ReplayedCount).Width(100).Filterable(e => e.Extra(false));
columns.Bound(p => p.RetryCount).Width(100).Filterable(e => e.Extra(false));
columns.Bound(p => p.AckCode).Width(100).Filterable(e => e.Extra(false));
columns.Bound(p => p.BatchingStatus).Width(100).Filterable(e => e.Extra(false));
})
// .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.Filterable()
.Pageable(page => page.PageSizes(new int[]{10,25,50,100}).Enabled(true))
.Sortable()
.Scrollable(src => src.Height("auto"))
.Resizable(resize => resize.Columns(true))
)
I am stuck with a very small problem. Please help me in solution to the problem.
Basically, I need to compare the value in the BatchingStatus field in my dataset accordingly need to disable the checkbox in the grid.
Following is my code. Attached the screen shot of portal.
@using (Html.BeginForm("ReplaySelectedMessages", "Home"))
{
<div id="gridContent">
<h1></h1>
@(Html.Kendo().Grid<XYZ.MessageReplay.MvcApp.Models.LogModel>(Model)
.Name("gridTable")
//.EnableCustomBinding(true)
.HtmlAttributes(new {style = "font-family: verdana,arial,sans-serif; font-size: 11px;color: #333333;border-color: #999999;"})
.Columns(columns =>
{
columns.Template(@<text>#if(@item.BatchingStatus) == 0 { # <input class='box' id='assignChkBx' name='assignChkBx' type='checkbox' value='@item.LogID' /> #} else {# <input class='box' id='assignChkBx' name='assignChkBx' type='checkbox' value='@item.LogID' disabled='disabled'/> #} # </text>).HeaderTemplate(@<text><input class="selectAll" type="checkbox" id="allBox" onclick="toggleSelection()"/></text>).Width(20);
columns.Bound(p => p.LogID).Template(p => Html.ActionLink(((string)p.LogID), "MessageDetails", new { logid = p.LogID })).Width(200);
columns.Bound(p => p.ReceivePortName)
.Width(100)
.Filterable(ft => ft.UI("ReceivePortsFilter").Extra(false));
columns.Bound(p => p.SendPortName).Width(100).Filterable(ft => ft.UI("SendPortsFilter").Extra(false));
columns.Bound(p => p.loggedDate).Format("{0:MM/dd/yyyy hh:mm tt}").Filterable(f => f.UI("DateTimeFilter").Extra(true)).Width(100);
columns.Bound(p => p.ControlID).Width(100).Filterable(e => e.Extra(false));
columns.Bound(p => p.SenderID).Width(100).Filterable(ft => ft.UI("SenderIDFilter").Extra(false));
columns.Bound(p => p.ReceiverID).Width(100).Filterable(ft => ft.UI("ReceiverIDFilter").Extra(false));
columns.Bound(p => p.InterchangeID).Width(100).Filterable(e => e.Extra(false));
columns.Bound(p => p.ReplayedCount).Width(100).Filterable(e => e.Extra(false));
columns.Bound(p => p.RetryCount).Width(100).Filterable(e => e.Extra(false));
columns.Bound(p => p.AckCode).Width(100).Filterable(e => e.Extra(false));
columns.Bound(p => p.BatchingStatus).Width(100).Filterable(e => e.Extra(false));
})
// .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.Filterable()
.Pageable(page => page.PageSizes(new int[]{10,25,50,100}).Enabled(true))
.Sortable()
.Scrollable(src => src.Height("auto"))
.Resizable(resize => resize.Columns(true))
)