I have a bound Hierarchical UltraWebGrid and one of the columns is a DropDownList / ValueList with values (Read, Write, Execute). When I change the vale of the parent column DropDownList, I would like to set each child's DropDownList column to be the same selectedValue as the parent. For example, if select "Execute" from the parents DropDownList, I need to loop through each of that parents child rows on the client side and set the selectedValue = "Execute" as well. Right now I am working with the ValueListSelChangeHandler but can use a hand here. Thanks!
I came up with this solution on my own but I am looking for something a bit more robust...
function valueListSelChangeHandler(gridID, valueListID, cellID) { var valueList = document.getElementById(valueListID); var parentRow = igtbl_getRowById(cellID); var cell = igtbl_getCellById(cellID); var children = cell.Row.getChildRows(); var newValue; if (valueList.selectedIndex == 0){ newValue = 'Read'; } else if (valueList.selectedIndex == 1){ newValue = 'Write'; } else if (valueList.selectedIndex == 2){ newValue = 'Execute'; } if (children.length > 0) { for (var i = 0; i < children.length; i++){ var row = parentRow.getChildRow(i); var oldValue = row.getCell(1).getValue();
if (oldValue != null){ row.getCell(1).setValue(newValue); } } } }
Hi jdymond
I am having a similar issue, which I posted on here, but it seems to me that there is not much interest in helping Ultrawebgrid users (as it is no longer included in the newer Net Advantage suites); any how, I would really appreciate your input on the following:
"I have an Ultrawebgrid with a valuelist column called WorkCategory (statically loaded with values at Page_Load).
When the user selects a value for WorkCategory (captured at AfterCellUpdated event), a second ValueList called WorkSubCategory is created and loaded on the following cell, based on the WorkCategory valuelist's selected value and populated for the user to also select.
When the grid is loaded, while the WorkSubCategory column values are displayed correctly, when clicking on the cells themselves to choose another value, no valuelist dropdown is shown, because this is not created until the WorkCategory dropdownlist changes value. This is frustrating for the users, because if they want to change the work sub category, they have to first change work category to another value, then change it back to the desired value, and then access the drop down list on the Work Sub Category column.
What I would like to do is to have both value lists loaded and available at page_load, so as to enable editing of the second valuelist without having to change the first column's value first. I have tried to do that in code-behind in method called on Page_Load; while the grid loads ok, clicking on the WorkSubCategory throws a nasty javascript exception.
Any ideas on how this can be achieved? Which event should I hook this up to? "