Hello,
I'm using the GridFilterMode.Row but it doesn't work. My Grid is define in two parts :
- on the server :
public static class GridPluginServeurTypeA
{
public static GridBuilder<T> Grid<T>(HtmlHelper htmlHelper) where T : class
{
WidgetFactory wf = new WidgetFactory(htmlHelper);
GridBuilder<T> gb = wf.Grid<T>();
gb.Name("Grid");
gb.Pageable(pager => pager.PageSizes(new[] { 5, 10, 20, 50, 75, 100 }).ButtonCount(3).Refresh(true));
gb.Sortable(s => s.SortMode(GridSortMode.MultipleColumn));
gb.Navigatable();
gb.Pageable();
gb.Groupable();
gb.Resizable(resiz => resiz.Columns(true));
gb.Reorderable(reoder => reoder.Columns(true));
gb.DataSource(dataSource => dataSource.Ajax()
.PageSize(10)
.Batch(false)
.ServerOperation(true)
);
gb.Events(e => e.DataBound("onDataBound"));
return gb;
}
}
- on the client :
Gtool.Utilities.Telerik.Grid.GridPluginServeurTypeA.Grid<Keorisk.Domain.DtoTUtilisateur>(Html)
.Columns(columns =>
{
columns.Bound(p => p.Id).Title(TexteAffiche.Instance.Texte["LstUtilisateurColId"]).ClientTemplate("#= ColonneId(data) #").Locked(true);
columns.Bound(p => p.Nom).Title(TexteAffiche.Instance.Texte["LstUtilisateurColNom"]).Locked(true).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
columns.Bound(p => p.Prenom).Title(TexteAffiche.Instance.Texte["LstUtilisateurColPrenom"]).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
columns.ForeignKey(p => p.RoleId, (System.Collections.IEnumerable)ViewData["roles"], "Id", "Libelle").Title(TexteAffiche.Instance.Texte["LstUtilisateurColRole"]).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
columns.ForeignKey(p => p.StatutId, (System.Collections.IEnumerable)ViewData["statuts"], "Id", "Libelle").Title(TexteAffiche.Instance.Texte["LstUtilisateurColStatut"]).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
columns.Bound(p => p.Login).Title(TexteAffiche.Instance.Texte["LstUtilisateurColLogin"]);
columns.Command(com => { com.Edit().Text("Edit"); com.Destroy().Text("Cancel "); });
})
.Editable(ed => ed.Mode(GridEditMode.PopUp).TemplateName("Utilisateur"))
.Filterable(ftb => ftb.Mode(GridFilterMode.Row).Enabled(true))
.DataSource(dataSource => dataSource.Ajax()
.Model(model => model.Id(user => user.Id))
.Model(model => model.Field(user => user.Id).Editable(false))
.Model(model => model.Field(user => user.RoleId).Editable(false))
.Model(model => model.Field(user => user.StatutId).Editable(false))
.Read(read => read.Action("GetAllUtilisateursGrid", "Admin"))
.Update(update => update.Action("UpdateUtilisateurGrid", "Admin"))
.Destroy(update => update.Action("DestroyUtilisateurGrid", "Admin"))
)
)
The filter row is not visible and I don't understand why.
Can anybody help me ?
I'm using the GridFilterMode.Row but it doesn't work. My Grid is define in two parts :
- on the server :
public static class GridPluginServeurTypeA
{
public static GridBuilder<T> Grid<T>(HtmlHelper htmlHelper) where T : class
{
WidgetFactory wf = new WidgetFactory(htmlHelper);
GridBuilder<T> gb = wf.Grid<T>();
gb.Name("Grid");
gb.Pageable(pager => pager.PageSizes(new[] { 5, 10, 20, 50, 75, 100 }).ButtonCount(3).Refresh(true));
gb.Sortable(s => s.SortMode(GridSortMode.MultipleColumn));
gb.Navigatable();
gb.Pageable();
gb.Groupable();
gb.Resizable(resiz => resiz.Columns(true));
gb.Reorderable(reoder => reoder.Columns(true));
gb.DataSource(dataSource => dataSource.Ajax()
.PageSize(10)
.Batch(false)
.ServerOperation(true)
);
gb.Events(e => e.DataBound("onDataBound"));
return gb;
}
}
- on the client :
Gtool.Utilities.Telerik.Grid.GridPluginServeurTypeA.Grid<Keorisk.Domain.DtoTUtilisateur>(Html)
.Columns(columns =>
{
columns.Bound(p => p.Id).Title(TexteAffiche.Instance.Texte["LstUtilisateurColId"]).ClientTemplate("#= ColonneId(data) #").Locked(true);
columns.Bound(p => p.Nom).Title(TexteAffiche.Instance.Texte["LstUtilisateurColNom"]).Locked(true).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
columns.Bound(p => p.Prenom).Title(TexteAffiche.Instance.Texte["LstUtilisateurColPrenom"]).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
columns.ForeignKey(p => p.RoleId, (System.Collections.IEnumerable)ViewData["roles"], "Id", "Libelle").Title(TexteAffiche.Instance.Texte["LstUtilisateurColRole"]).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
columns.ForeignKey(p => p.StatutId, (System.Collections.IEnumerable)ViewData["statuts"], "Id", "Libelle").Title(TexteAffiche.Instance.Texte["LstUtilisateurColStatut"]).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
columns.Bound(p => p.Login).Title(TexteAffiche.Instance.Texte["LstUtilisateurColLogin"]);
columns.Command(com => { com.Edit().Text("Edit"); com.Destroy().Text("Cancel "); });
})
.Editable(ed => ed.Mode(GridEditMode.PopUp).TemplateName("Utilisateur"))
.Filterable(ftb => ftb.Mode(GridFilterMode.Row).Enabled(true))
.DataSource(dataSource => dataSource.Ajax()
.Model(model => model.Id(user => user.Id))
.Model(model => model.Field(user => user.Id).Editable(false))
.Model(model => model.Field(user => user.RoleId).Editable(false))
.Model(model => model.Field(user => user.StatutId).Editable(false))
.Read(read => read.Action("GetAllUtilisateursGrid", "Admin"))
.Update(update => update.Action("UpdateUtilisateurGrid", "Admin"))
.Destroy(update => update.Action("DestroyUtilisateurGrid", "Admin"))
)
)
The filter row is not visible and I don't understand why.
Can anybody help me ?