ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Grid Inline Combobox get data list based on its row value
Title:
B
I
{code}
?
I am currently using your grid in my current project for CRUD operations. Users can create, edit and delete from the grid very easily and it works great. I also am using a series of combo boxes down one column that enables the user to either type their specific value, or choose their value. For example, here is my current code: @(Html.Awe().Grid(gridId) ... .Columns( ... new Column { Bind = "Value", Header = "Value" } .Mod(o => o.Inline(Html.Awe().AjaxRadioList("Value").Combobox(z => z.Caption("")).DataFunc("utils.getItems(DataList)"), "Value")) *I would like the change the DataList query so that it queries each row based upon the current value of "Name" on a row per row basis.*
Save Changes
Cancel
eliawesome
asked at 06 Jun 2019
Answers
B
I
{code}
?
you can pass values of the current row to the js function that gets the data `DataFunc` so instead of `.DataFunc("utils.getItems(DataList)")` call `.DataFunc("myfunc('.(AnyPropNameYouNeed)')")` in your case `.DataFunc("myfunc('.(Name)')")`
Save Changes
Cancel
Omu
answered at 06 Jun 2019
If I try and do this: function LoadRowData(Name){ var data = db.ComponentMan.Where(x => x.Name = Name); var list = @Html.Raw(DemoUtils.Encode(data.Select(o=> new KeyContent(o.Name,o.Name)))); } I still get an error on the last line. "The name 'data' does not exist in the current context." It's as if it doesn't recognize variables once inside the @Html.Raw
at 11 Jun 2019
eliawesome
https://www.aspnetawesome.com/learn/mvc/CommonProblems#Isolate-the-problem
at 13 Jun 2019
Omu
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