Hi,
I am trying to server editing for grid.
I need to show Delete links for selective rows in my grid.
But the grid is showing delete links for all rows. What may be the reason behind this?
Following is my code.
<%int index = 0; %>
<%Html.Telerik().Grid(Model)
.Name("Grid")
.Toolbar(commands => commands.Insert())
.DataKeys(keys => keys.Add(c => c.RoleID))
.DataBinding(dataBinding => dataBinding
.Server()
.Select("SelectRole", "Home")
.Insert("InsertRole", "Home")
.Update("SaveRole", "Home")
.Delete("DeleteRole", "Home")
)
.Columns(
columns =>
{
columns.Add(o =>
{
%>
<%= Html.Encode(o.Description)%>
<%
})
.Title("Description");
columns.Add(o =>
{
%>
<%if (o.IsStatusEnabled)
{%>
<%=Html.Encode("Enabled") %>
<%}
else
{%>
<%=Html.Encode("Disabled")%>
<%}
%>
<%
})
.Title("Status")
.Width("8%");
columns.Command(commands =>
{
commands.Edit();
if (Model. Info.ElementAt(index).IsDefaultRole == false)
{
commands.Delete();
}
index++;
})
})
.Render();
%>
Thanks,
Kapil