Dear Kendo team,
Is there a way to bind a cell to a dropdown list on selection of the same row's another dropdown list's change event?
I have attached a screenshot. On selection of B3's dropdown list, I need to generate a dynamic dropdown list in C3 column.
Can you help me with an example code? I tried to search this in the forum, but couldn't find the exact answer.
Thanks in advance :)
Best Regards
Iffat
5 Answers, 1 is accepted
Hi Iffat,
I would suggest you subscribe to the change event of the Spreadsheet. In the event handler, you could check the changed cell. Then, you could use the Range validation method to set validation with dataType list to another cell. Below is a sample implementation:
change: function(e){
if(e.range._ref.col ==1 && e.range._ref.row == 0 ){
setTimeout(function() {
var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
var sheet = spreadsheet.activeSheet();
sheet.range("D1").value('Changed');
sheet.range("D1").validation({
dataType: "list",
showButton: true,
comparerType: "list",
from: '"First, Second, Third"',
allowNulls: true,
type: "reject"
});
});
}
},
Here is a Dojo example where the described above is demonstrated. I hope you will find it helpful.
Regards,
Neli
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
![](/forums/images/avatarimages/default.gif)
Hi Iffat,
Loading dynamically the options for the validation DropDownList is currently not supported. We have a Feature Request on this functionality here https://feedback.telerik.com/kendo-jquery-ui/1360250-spreadsheet-validation-dropdown-data-binding and I have added a vote on it on your behalf. If the community shows interest in this feature we will consider it for implementation in a future release.
Regards,
Aleksandar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
![](/forums/images/avatarimages/default.gif)
Thanks.
My next question would be, if it only supports a comma separated string, how does it track which value (we need to get the Id of that selected value of dropdown list)is selected on saving the sheet in database?
If it's not possible and I need to use a custom cell editor, how to get selected item's id onsave?
Thanks in advance
Iffat
Hello Iffat,
When you use a comparerType:list you can pass a comma separated list, that is to be used as values, but not a list of objects. Even if you implement a custom editor the selected value of the editor needs to be set as a value of the cell. You can still use the change event to get the value of the changed range, for example https://dojo.telerik.com/atuHaWuF
Regards,
Aleksandar
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.