ASP.NET MVC5
I have a combobox in a grid (InLine Edit):
columns.Bound(x=>x.AccountID).EditorTemplateName("MyTemplate")
Where MyTemplate
is in /Shared
There are millions of Accounts.
When I try to edit the combo box in a grid and choose a new value, the ID of the Account, not the name, appears. This is because of course the name of the account is not immediately present so in the Read().Data() of the ComboBox.Datasource I need to send additional data; the AccountID.
My ComboBox Template looks like this:
.DataSource(source=>
source.Read(read =>
read.Action("ReadAccounts".....)
.Data("HERE IS WHERE I NEED TO SEND THE ACCOUNT ID AS EXTRA DATA
WHEN THIS CBO TEMPLATE IS IN A GRID")
Thank you
Here's the Combo Box defined in a partial view in
~/Views/Shared/EditorTemplates/ComboBoxTemplate
Here's the view and controller action
Like with any Ajax calls, placing break points in the code might prevent the widget from performing as intended. For ex. using incell editing while clicking the Field to edit, if you place a breakpoint in
GetCombo
the ComboBox editor template will not default correctly to that value.