This question is locked. New answers and comments are not allowed.
Is there any way to apply initial FilterDescriptor?
here is what I'm trying to do:
public static GridBuilder<T> ApplyCommand<T>(this GridBuilder<T> grid, GridCommand command)
where T : class
{
if (command == null)
return grid;
if (command.SortDescriptors.Count > 0 && command.SortDescriptors[0].SortDirection == ListSortDirection.Ascending)
{
grid.Sortable(x => x.OrderBy(y => y.Add(command.SortDescriptors[0].Member)));
}
if (command.Page > 0)
{
grid.Pageable(x => x.PageTo(command.Page));
}
foreach (IFilterDescriptor item in command.FilterDescriptors)
{
// TODO initialize grid filtering
}
return grid;
}
here is what I'm trying to do:
public static GridBuilder<T> ApplyCommand<T>(this GridBuilder<T> grid, GridCommand command)
where T : class
{
if (command == null)
return grid;
if (command.SortDescriptors.Count > 0 && command.SortDescriptors[0].SortDirection == ListSortDirection.Ascending)
{
grid.Sortable(x => x.OrderBy(y => y.Add(command.SortDescriptors[0].Member)));
}
if (command.Page > 0)
{
grid.Pageable(x => x.PageTo(command.Page));
}
foreach (IFilterDescriptor item in command.FilterDescriptors)
{
// TODO initialize grid filtering
}
return grid;
}