I have an Ultrawebgrid with two Divs in the RowEditTemplate, with a radiobutton list in each Div. One Div is displayed if any row but the last row is selected, the other is displayed only if the last row is selected. DivA has the radiobuttonlist only. DivB has a radiobuttonlist and a textbox. I have the javascript to determine which div opens. My problem is that no matter which Div is opened the radiobuttonlist always shows the selection of the last row. I've tried to write javascript function to initialize each control like I would an IG control, but visual studio expects their oninit methods to be in the code behind. These are standard ajax radiobuttonlists. How can I initialize them in javascript? Thanks.
This is a follow up. It seems it would be much easier to have one div. My Div has a table containing a row for the ID, row for the radiobuttonlist and a row for the text box. Instead of dealing with divs and multiple controls, the one div should suffice. What I cannot do in this instance is hide the row which has the text box. IN the BeforeRowTemplateOpenHandler, It should hide the row with the textbox for all rows selected except the last row, which will display both the radiobuttonlist and the textbox. I tried using igtbl_getElementById(templateId).children["divControls"].children["tblControls"].rows[2].style.display("none"); from a different example, but I get an error that the children tblcontrols doesn't exist.
Hello dbishop9,
If you want to initialize the combo box group from JavaScript events you can use window or body “onload” Client event - http://scriptasylum.com/tutorials/pageevents.html
This event is fired when the page or form is loaded and if the needed controls are available on the page you can access and modify them.
About your second question – your approach is correct (using “display = none” - http://www.javascriptf1.com/tutorial/javascript-hide-table-row.html?page=2 ) but in order to work correctly you will need to find the row HTML element first.
The correct element can be found by debugging your project or by using Developer tools (F12) to inspect and identify the needed element. Once the element is found you can use the mentioned code to hide it.
Let me know if you have additional questions.