BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi Mirko,
Thanks for your
interest in Syncfusion product.
We would like to
let you know that your requirement “Restore filter settings on page load”
has been achieved on the server side. To achieve your requirement use Filter
Descriptor values to restore filter settings on page load. To maintain paging, Sorting
and other grid functionality use session concepts. The code snippets is shown
below,
Code Snippet:
[CS]
public
class HomeController : Controller
{
…
public ActionResult Index()
{
if (Session["Args"] != null)
{
List<AutoFormatting>
data1 = new List<AutoFormatting>();
var arg = (List<FilterDescriptor>)Session["Args"];
for (int i = 0; i <
arg.Count; i++)
{
var col =
arg[i].ColumnName;
var val =
arg[i].Value.ToString();
List<AutoFormatting> data = (List<AutoFormatting>)AutoformatRepository.GetData();
foreach(var dat in data)
{
if (
dat.Currency.ToString()==val.ToString() || dat.Dates.ToString() == val.ToString() || dat.Number.ToString() ==
val.ToString() || dat.Telephone.ToString() == val.ToString())
{
data1.Add(dat);
}
}
}
Session["Data"] =
data1;
return View(data1);
}
var data2 = AutoformatRepository.GetData();
return View(data2);
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(PagingParams
args)
{
if (args.FilterDescriptors.Count !=
0)
{
Session["Args"] =
args.FilterDescriptors;
}
if (Session["Data"] != null)
{
List<AutoFormatting>
data1 = (List<AutoFormatting>)Session["Data"];
Session["Data"] =
data1;
return data1.GridActions<AutoFormatting>();
}
IEnumerable data = AutoformatRepository.GetData();
return data.GridActions<AutoFormatting>();
}
…
}
For your convenience
we have created a sample and the same can be download from the below attachment.
Please let us know
if you need any further assistance.
Regards,
Prabhu Sarvesan