简体   繁体   中英

Accessing the MasterTableView Edit Form in Radgrid to get reference to textbox

There are two things I would like help with please. I need help accessing the currently edited existing row in the Radgrid, as as well as the index of the Edit form when trying to add a new record to the table/

       function OnClientSelectedIndexChanged(sender, eventArgs) {
           var item = eventArgs.get_item();
          // alert(item.get_value());
           grid = $find("<%= rgSecurity.ClientID %>");
           var MasterTable = grid.get_masterTableView();
           var selectedRows = MasterTable.get_selectedItems();
//           alert("about to get to grid");
           alert(selectedRows.length);
           if (selectedRows.length > 1) {
               for (var i = 0; i < selectedRows.length; i++) {
                   var row = selectedRows[i];
                   alert(row);
                   inputField = MasterTable.getCellByColumnUniqueName(row, "Item")
                   alert(inputField);
                   if (inputField) {
                       inputFieldValue = inputField.value
                       break;
                   }
               }
           }
           else  
           {
         //  alert(inputField);
           }
         window.radopen('<%=PopLink %>?sel=' + item.get_value() + "&avail=" + inputFieldValue, "UserRoleDialog");
           return false;
       }

The currently edited grid row can be retrieved on the server using the EditItems[0] collection of the master table or through the e.Item argument inside the EditCommand server event handler. The index of the edited row can be fetched from the ItemIndex property of the item referenced as explained in the first sentence.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM