开发者

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")
              开发者_如何学Go     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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜