On post back of a multiselect listbox from within "SetEditFormTemplateContent" on a GridView only the first item is posted.
Html.ListBoxFor(model => model.RoleList, new MultiSelectList((List<SelectListItem>)Model.Roles, "Value", "Text", Model.RoleList), new { @class = "form-control", Multiple = "multiple" })
My post back should look like:
var roleList = Request.Params["RoleList"];
roleList === "1,2,3"
I'm not looking to use DevExpress control.
Hello,
It's difficult to determine the cause of the issue based on this code snippet. Make sure that our model binder is defined in your application (see Binding Data Editors to Data). If this doesn't help, would you please provide us with code snippets that illustrate GridView settings and EditFormTemplate's implementation. If possible, make a simple runnable project illustrating your scenario and send it to us. This way, we can concentrate on the problematic area and provide you with the most appropriate solution.
Thanks,
Artem
Debug the project and look at the output.
Click edit or new on the gridview and try selecting multiple options and posting them back to the controller. It appears the Javascript is not properly collecting Form data when posting it back to the server.
I provided a test of the gridview as well as a working example.
Also, to note, I even upgraded to the latest version of DevExpress.
Hi,
I was able to reproduce this issue on our side. I will discuss this issue with the team. We will contact you once we have any results. We greatly appreciate your time and cooperation.
Thank you!