Oct 08, 2013, 6:44 AM
[CLOSED] DirectEvent Actionmethod with StoreRequestParameters object
Hi
mine is a Razor view engine application.
I have a gridpanel to which I have applied remote paging.
On a button click through DirectEvent I am calling a Actionmethod.
In the actionmethod I have following code
The issues I face is;
1) StoreRequestParameters object variables are -1 and null. Thus all records are set to the store and not as per page size
2) The gridpanel is not showing any records in it.
mine is a Razor view engine application.
I have a gridpanel to which I have applied remote paging.
On a button click through DirectEvent I am calling a Actionmethod.
In the actionmethod I have following code
public ActionResult ImportClick(string scenarioId, string type, StoreRequestParameters parameters)
{
...
...
var store = this.GetCmp<Store>("Store1");
var finalPivotedList = GetPivotedList(AllScenarioSales);
System.IO.File.Delete(fname);
if (!string.IsNullOrEmpty(parameters.SimpleSort))
{
finalPivotedList.Sort(delegate(ProjectedSalesGridModel x, ProjectedSalesGridModel y)
{
object a;
object b;
int direction = parameters.SimpleSortDirection == SortDirection.DESC ? -1 : 1;
a = x.GetType().GetProperty(parameters.SimpleSort).GetValue(x, null);
b = y.GetType().GetProperty(parameters.SimpleSort).GetValue(y, null);
return CaseInsensitiveComparer.Default.Compare(a, b) * direction;
});
}
int limit = parameters.Limit;
if ((parameters.Start + limit) > finalPivotedList.Count)
{
limit = finalPivotedList.Count - parameters.Start;
}
List<ProjectedSalesGridModel> packs = (parameters.Start < 0 || limit < 0) ? finalPivotedList : finalPivotedList.GetRange(parameters.Start, limit);
var data = new Paging<ProjectedSalesGridModel>(packs, finalPivotedList.Count);
store.LoadData(data);
...
...
return new DirectResult() { IsUpload = true };
}
This code updates a stores records.The issues I face is;
1) StoreRequestParameters object variables are -1 and null. Thus all records are set to the store and not as per page size
2) The gridpanel is not showing any records in it.
Last edited by Daniil; Oct 15, 2013 at 6:42 AM.
Reason: [CLOSED]