ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
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 at 03 Oct 2019
you can use `Parent`, `Parameter`, and `ParameterFunc` grid extensions to send additional parameters https://www.aspnetawesome.com/learn/mvc/general#Binding-to-Parents
at 03 Oct 2019
Omu
Thank You, are there any way to intercept grouping event: dragging column header on the group bar by user?
at 03 Oct 2019
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 ?
at 03 Oct 2019
Omu
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.
at 03 Oct 2019
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
Omu
answered at 03 Oct 2019
Yes, this solved my problem. Thank You&
at 03 Oct 2019
Vladimir Kerzhentsev
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK