ASP.net
Awesome
Learn
Forum
Buy
Sign In
this site works best with javascript enabled
Ask Question
How to intercept grouping event?
Title:
B
I
{code}
?
Is there any way to intercept grouping event: dragging column header on the group bar by user and pass additional parameter to controller ?
Save Changes
Cancel
Vladimir Kerzhentsev
asked 2 months ago
you can use `Parent`, `Parameter`, and `ParameterFunc` grid extensions to send additional parameters https://www.aspnetawesome.com/learn/mvc/general#Binding-to-Parents
2 months ago
o
Thank You, are there any way to intercept grouping event: dragging column header on the group bar by user?
2 months ago
Vladimir Kerzhentsev
not really, you could handle `aweload` perhaps, not sure why would you need that, please explain what are you trying to build from the user point of view ?
2 months ago
o
I want to get following result: when user group by any of columns - pager turns off like g.PageSize = items.Count(); I have solution for grouping by user button click: <a onclick="group();" >GROUP INSPECTOR</a> function group() { $('#@gridId').data('api').load({ group: ['inspector.login'], oparams: { cmd: 'nopage' } }); } but I can't manage how to do the same without button.
2 months ago
Vladimir Kerzhentsev
Answers
B
I
{code}
?
ok, so you want to turn off grouping when the user groups by any column, and you're doing this already using grid api by calling `g.PageSize = items.Count();` you can do this in your controller: if (g.Groups != null && g.Groups.Length > 0) { g.PageSize = items.Count(); }
Save Changes
Cancel
o
answered 2 months ago
Yes, this solved my problem. Thank You&
2 months ago
Vladimir Kerzhentsev
please
Sign In
to leave an answer