Hi Michael,
We can’t set the “groupBy” via codebehind because while you give (“EditType=’Dropdown’”), the dropdown element will be rendered dynamically. So we can’t access the dynamic element in code behind. In the grid, dropdown will be render in the actionComplete event. We can bind the “groupBy” field for DropDownList in the actionComplete event.
In your provided code, you have get the dataSource by binding text as name and value as MBO1 and assigned that dataSource to grid Column.
<code>
Session["MBO"] = context.MBOs.OrderBy(a=>a.BU).ThenBy(a=>a.MBO1).Select(o => new { text = Name, value = o.MBO1, bu=o.BU}).ToList(); //BU is the groupby field
</code>
If you get the dataSource(Session["MBO"]) with text and value, then you no need specify the text and value in DropDownList which is specified in script side code as shown below:
<code>
$("#OrdersGridShipCity").ejDropDownList({ fields: { text: "ShipCity", value: "ShipCity"} });
</code>
Also, please make sure whether you have bound proper field for groupBy in DropDownList which is resides in the Session[“MBO”] datasource. Please find the code for same:
<code>
$("#OrdersGridShipCity").ejDropDownList({ fields: { text: "ShipCity", value: "ShipCity",groupBy: "ShipCountry" } });
Session["MBO"] = context.MBOs.OrderBy(a=>a.BU).ThenBy(a=>a.MBO1).Select(o => new { text = Name, value = o.MBO1, bu=o.BU}).ToList(); //BU is the groupby field
</code>
If still you face the problem, please share us the screenshot for which is get the “Session[“MBO”]” and revert us by modifying the sample which is updated in our first update based on your application along with replication procedure. This will help us to serve you better.
Regards
Kasithangam