In my gridview, there is a nested structure with a footer row for inserting data. When the parent row expands, the footer controls are generated. There are two dropdowns where the second dropdown's options depend on the selection in the first dropdown. However, I'm facing an issue - when I change the value in the first dropdown, the change event is not triggered. The edit functions work fine within the endRequest function, but the insert controls do not.
Below is the markup:
<!-- ASP.NET UpdatePanel -->
...
This section of code-behind populates the dropdowns in the footer row:
// C# Code-Behind
...
And here's the associated JavaScript:
// JavaScript Function
...
UPDATE After making some changes based on Aleksey's suggestion, the change function now triggers successfully. However, the Service Name dropdown is still not updating accordingly. It seems that the selector #recdevgvDDListServiceNameInsert is not being recognized. The control has ClientIDMode set to Static.
The dropdowns are within an update panel and GridView. I've tried adding the update panel control as the parent in the selector, without success. I also use document.ready() and endRequest function for Edit mode.
I attempted using bindEvent function but encountered the same issue.
Here's the updated JavaScript:
// Updated JavaScript Function
...
UPDATE In Edit Mode, I made specific adjustments to display the "Choose service..." option in the dropdown list. Although the dropdown is now showing the correct text, it is still disabled. To enable the disabled chosen dropdown, I had to use $("select").prop("disabled", false), which allowed the rest of the function to work properly.