Hi Friends,
I want call the "Group by this column" option when the form is loaded and show the grid to the user grouped by that particular column in x++ code. Can you provide some hint for the code and the place where the code can written.
Hi Friends,
I want call the "Group by this column" option when the form is loaded and show the grid to the user grouped by that particular column in x++ code. Can you provide some hint for the code and the place where the code can written.
Is it the requirement to call it by x++ code only? Because this can be simply done by Feature management. Please check this blog.
I think it won't work in standard form. It will work only in custom form.
If you find any solution to this in future, please post it here so it will be useful for others.
Thanks,
Girish S.
Can you provide more details on how the results are different
Hi Girish,
Its working in custom forms, but its not producing same results as manual grouping
Are you able to solve this?
Use name method to get the name of the particular control.
I tried in the standard form it's not working. I tried it in different method also it's not working.
Its working on custom form where its open with group by enabled and also, I think it works on latest version only.
I think it works only for custom form only not for standard forms.
Thanks,
Girish S.
Just type the control name in double quotes.
FormGridControl.addGroupBy("ControlName1");
Thanks,
Girish S.
Hi Girish,
Thanks for the reply.
I tired GroupBy method the way you suggested. Actually the parameter to be passed for the method GroupBy is string.
when I tried to pass the control name, it gives error saying 'The required type is string but the actual type is formstringcontrol'
what string should I pass in the parameter?
Regards
Martin
Hi, You can add group by in ExecuteQuery method of form datasource
Check this article
Hi Martin,
On the FormGridControl there is a method named groupBy(controlName). Use this method to add a groupBy of the grid.
Add this code on the init method of the form.
Get the grid control and control to group by in the OnInitialize event handler of the form.
Thanks,
Girish S.
André Arnaud de Cal...
292,234
Super User 2025 Season 1
Martin Dráb
230,994
Most Valuable Professional
nmaenpaa
101,156