Hi -
I have the grid below and am trying to get the value of a certain column to dynamically render a set of workflow buttons based on that value. Is it possible to do this?
Html.Kendo().Grid<ViewModelName>()
.Name("GridName")
.ToolBar(commands => commands.Create())
.DataSource(ds =>
ds.Ajax()
.Read("Select", "EmpActivitySummary", new { EmpActivityId = RouteData.Values["id"] })
.Update("Update", "EmpActivitySummary", new { EmpActivityId = RouteData.Values["id"] })
.Destroy("Delete", "EmpActivitySummary")
.Create("Insert", "EmpActivitySummary", new { EmpActivityId = RouteData.Values["id"] })
.Model(m =>
{
m.Id(x => x.Id);
m.Field(x => x.EmpActivityId).Editable(false);
m.Field(x => x.Id).Editable(false);
m.Field(x => x.Approved).Editable(false);
})
)
.PrefixUrlParameters(false)
.Columns(r =>
{
r.Command(com =>
{
com.Edit();
com.Destroy();
var currentStatus = r.Template(model => model.Approved); // <--------------- I'm trying to get the value of this column
var utilities = new WorkflowUtilities("Workflow Name");
var steps = utilities.GetSteps(currentStatus);
foreach (var step in steps.Where(step => Roles.IsUserInRole(step.RequiredRole)))
{
com.Custom(step.ButtonText).Click("ProcessWorkflowStep").SendDataKeys(true);
}
}).Title("Commands").Width(60);
r.Bound(x => x.Id).Width(100);
r.Bound(x => x.Field);
r.Bound(x => x.Quantity);
r.Bound(x => x.Price).AsCurrency();
r.Bound(x => x.Date);
r.Bound(x => x.Approved);
})
.Render();
I have the grid below and am trying to get the value of a certain column to dynamically render a set of workflow buttons based on that value. Is it possible to do this?
Html.Kendo().Grid<ViewModelName>()
.Name("GridName")
.ToolBar(commands => commands.Create())
.DataSource(ds =>
ds.Ajax()
.Read("Select", "EmpActivitySummary", new { EmpActivityId = RouteData.Values["id"] })
.Update("Update", "EmpActivitySummary", new { EmpActivityId = RouteData.Values["id"] })
.Destroy("Delete", "EmpActivitySummary")
.Create("Insert", "EmpActivitySummary", new { EmpActivityId = RouteData.Values["id"] })
.Model(m =>
{
m.Id(x => x.Id);
m.Field(x => x.EmpActivityId).Editable(false);
m.Field(x => x.Id).Editable(false);
m.Field(x => x.Approved).Editable(false);
})
)
.PrefixUrlParameters(false)
.Columns(r =>
{
r.Command(com =>
{
com.Edit();
com.Destroy();
var currentStatus = r.Template(model => model.Approved); // <--------------- I'm trying to get the value of this column
var utilities = new WorkflowUtilities("Workflow Name");
var steps = utilities.GetSteps(currentStatus);
foreach (var step in steps.Where(step => Roles.IsUserInRole(step.RequiredRole)))
{
com.Custom(step.ButtonText).Click("ProcessWorkflowStep").SendDataKeys(true);
}
}).Title("Commands").Width(60);
r.Bound(x => x.Id).Width(100);
r.Bound(x => x.Field);
r.Bound(x => x.Quantity);
r.Bound(x => x.Price).AsCurrency();
r.Bound(x => x.Date);
r.Bound(x => x.Approved);
})
.Render();