ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Ajax dropdownlist inside Grid witn inline editing not picking up the value of the data property
Title:
B
I
{code}
?
My problem is that when the Edit button is clicked, the Dropdownlist always shows the first item rather than the current record value. The Grid column in the View is: new Column { Bind = "Complaint" } .Mod(o => o.Inline(Html.Awe().AjaxDropdown("Complaint").Url(Url.Page("Index", "GetComplaints")))) PAGE CODE: public IActionResult OnPostGetComplaints() // to come from a database later with more options { if (Complaints.Count == 0) { Complaints.Add(new ComplaintType { Complaint = "Service" }); Complaints.Add(new ComplaintType { Complaint = "Repair" }); Complaints.Add(new ComplaintType { Complaint = "Installation" }); } var list = Complaints.ToList().Select(o => new KeyContent(o.Complaint,o.Complaint)); return new JsonResult(new AweItems { Items = list}); }
Save Changes
Cancel
Clifton Nurse
asked at 05 Mar 2020
please reproduce the problem as explained here: https://www.aspnetawesome.com/learn/mvc/CommonProblems#Isolate-the-problem ( you can use razor pages demo )
at 06 Mar 2020
Omu
I presume the problem was solved ?
at 16 Mar 2020
Omu
Thank you for asking. It was solved in another way. I'm still newly learning how the AWE controls work. Your insistance that I had to Create a project (without a test database as your guidelines require) was simply too much work. I had a recent experience with another vendor who wanted me to send a test project and after I created and sent the project, it still did not go well with alot of back and forth between us. It took too much time and left me more frustrated. Thanks very much for your support.
at 16 Mar 2020
Clifton Nurse
Answers
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