I'm having an issue with the Combo editor type in the Grid, both when I edit a row and when I add a new one (the Combo has a default value when adding a new row).
The very first time the Combo opens after the page load, the default value or the pre-selected value if editing, is cleared to be empty. If I cancel the edit and then edit the same row (or edit a different row), the pre-selected value is now properly populated. I've attached screenshots below to illustrate what's going on. I have also included links to the images - they're not showing for me when viewing the message but that might be our corporate firewall blocking them.
(https://www.dropbox.com/s/4lfep74yzn4yols/Grid%20Combo%20Issue%201.png?dl=0)
(https://www.dropbox.com/s/6ee5i42xjs5ocx8/Grid%20Combo%20Issue%202.png?dl=0)
(https://www.dropbox.com/s/0o53il4i4p4e2jg/Grid%20Combo%20Issue%203.png?dl=0)
Am I missing something to get this to work properly the first time or is this a bug with the Combo editor control in the Grid?
Hello Keith,
Please take a look at the online sample of grid with combo editor: http://www.igniteui.com/combo/grid-with-combo-editor and compare it with your code to see what are the differences. It would be great if you could send me also a sample in order to debug it on my side. Waiting for your reply.
Regards,
Tsanna
I've attached a zip file that demonstrates the code I'm using. The biggest difference I can see is that on lines 16 through 28 of my Edit.cshtml file is that I'm disabling async processing temporarily while I fill an array with the possible dropdown values. I've found that if I do not disable async, the Grid never loads as it tries to fill in the values before the array is actually populated.
That exactly what I needed. Thanks for you help, Tsanna!
Please note that when the combo is bound to remote data source it's populated during the grid row is in edit mode for the first time. After that it's already populated and every subsequent grid interaction will display the respective combo value. If you want to display the initial combo value when entering edit mode for the first time, then I will suggest you to handle editCellStarting event of the grid and get the respective grid cell value associated to the combo editor. In order the combo to display this respective grid cell value when entering edit mode, you need to handle also combo dataBound event within the editCellStarting event to ensure that the combo is already bound and then assign the grid cell value to the combo. For instance:
$(document).delegate("#GridShipment", "iggridupdatingeditcellstarting", function (evt, ui) { if (ui.editor && ui.columnKey === "Side") { var val = ui.value; $(document).delegate(ui.editor, "igcombodatabound", function (e, ui) { ui.owner.value(val); });
} });
I'm attaching also a sample for your reference. If you have any further questions, please let me know.
Sorry, I forgot to mention that I'm working with version 2014.2.