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 set value for ColorDropdown
Title:
B
I
{code}
?
Hello, I can't assign a value from database to ColorDropdown in edit view. in controller: route route = db.routes.Find(id); In view: @Html.Awe().AjaxRadioList("route_color").ColorDropdown() Selected item in dropdown should be route.route_color
Save Changes
Cancel
Vladimir Kerzhentsev
asked at 14 Jul 2019
you set it the same way you would for any other control, by setting the corresponding viewmodel property, or `viewdata[property]` or `awesomeControl.Value(val)`, just make sure the value that you're setting is found within the available selection options
at 14 Jul 2019
Omu
Thank you, solution with .Value() solved my problem. But now i have another: how to change colors in dropdown, I've tried .Url(Url.Action("action", "controller")) and .DataFunc() with no luck.
at 14 Jul 2019
Vladimir Kerzhentsev
right now colors are hardcoded in `awem.js` you can find them inside `function colorDropdown(o) {`
at 15 Jul 2019
Omu
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