This question is locked. New answers and comments are not allowed.
I wanted to have a dynamic link to one of my columns, but as soon as I added it, I discovered that filterable and sortable no longer works on that column.
Here is the example.
@{Html.Telerik().Grid(Model)
.Name("Grid")
.DataKeys(keys=> {keys.Add(c=>c.ApplicationId);
})
.Columns(columns =>
{
columns.Template(o =>
@Html.ActionLink("Edit", "NotIndex", new
{
id = o.ApplicationId,
area = "Processing",
controller = "AppProcessing"
})).Title("Edit").Width(6);
columns.Bound(o => o.AccountNumber).Title("Acct #").Width(12);
columns.Bound(o=> o.ApplicationId).ClientTemplate(Html.ActionLink("Edit", "NotIndex", new
{
id = "<#= o.ApplicationId#>",
area = "Processing",
controller = "AppProcessing"
},null).ToString()).Title("App #").Width(6).Sortable(true).Filterable(true);
//columns.Bound(o => o.ApplicationId).Title("AppId").Width(12);
columns.Bound(o => o.LastName).Title("Name").Width(10);
columns.Bound(o => o.StartDate).Title("Date").Width(10).Format("{0:MM/dd/yyyy}");
columns.Bound(o => o.BranchOrDepartment).Title("Branch").Width(10);
columns.Bound(o => o.Owner).Width(10);
columns.Bound(o => o.Queue).Width(10);
columns.Bound(o => o.Processor).Title("Proc").Width(10);
columns.Bound(o => o.Decisioning).Title("Decision").Width(10);
columns.Bound(o => o.Status).Width(10);
}).Sortable()
.Filterable()
.TableHtmlAttributes(new {style = "table-layout:fixed;"})
.RowAction(row =>
{
if (row.DataItem.StartDate < DateTime.Today.AddDays(-30))
{
row.HtmlAttributes["style"] = "color:red;";
}
})
.Render();
As you can see, If I use columns.Template, or Columns.bound I can get the grid, but I lose the filtering and sorting when the grid is displayed. I want to keep those. I tried to force it as you see, and it still doesn't display. can you tell me how I can achieve this?
Here is the example.
@{Html.Telerik().Grid(Model)
.Name("Grid")
.DataKeys(keys=> {keys.Add(c=>c.ApplicationId);
})
.Columns(columns =>
{
columns.Template(o =>
@Html.ActionLink("Edit", "NotIndex", new
{
id = o.ApplicationId,
area = "Processing",
controller = "AppProcessing"
})).Title("Edit").Width(6);
columns.Bound(o => o.AccountNumber).Title("Acct #").Width(12);
columns.Bound(o=> o.ApplicationId).ClientTemplate(Html.ActionLink("Edit", "NotIndex", new
{
id = "<#= o.ApplicationId#>",
area = "Processing",
controller = "AppProcessing"
},null).ToString()).Title("App #").Width(6).Sortable(true).Filterable(true);
//columns.Bound(o => o.ApplicationId).Title("AppId").Width(12);
columns.Bound(o => o.LastName).Title("Name").Width(10);
columns.Bound(o => o.StartDate).Title("Date").Width(10).Format("{0:MM/dd/yyyy}");
columns.Bound(o => o.BranchOrDepartment).Title("Branch").Width(10);
columns.Bound(o => o.Owner).Width(10);
columns.Bound(o => o.Queue).Width(10);
columns.Bound(o => o.Processor).Title("Proc").Width(10);
columns.Bound(o => o.Decisioning).Title("Decision").Width(10);
columns.Bound(o => o.Status).Width(10);
}).Sortable()
.Filterable()
.TableHtmlAttributes(new {style = "table-layout:fixed;"})
.RowAction(row =>
{
if (row.DataItem.StartDate < DateTime.Today.AddDays(-30))
{
row.HtmlAttributes["style"] = "color:red;";
}
})
.Render();
As you can see, If I use columns.Template, or Columns.bound I can get the grid, but I lose the filtering and sorting when the grid is displayed. I want to keep those. I tried to force it as you see, and it still doesn't display. can you tell me how I can achieve this?