title: Cancelling the keypress [Enter] action on a Telerik RadGrid
body: <p>I have a <strong>Telerik Radgrid</strong> containing all the valid usernames and passwords that can be used to unlock functionnalities on my web page.</p>
  
  <p>The password is encrypted, so you have to click the row to decrypt and show the actual password. All usernames and passwords can be changed by an admin</p>
  
  <p>When the admin presses [ENTER] to submit the new username/password combination (instead of pressing the submit button), the new combination is actually submitted (which is fine).</p>
  
  <hr>
  
  <p>However, my problem is that, by default, the RadGrid selects the next row, which decrypts the password and lets you edit the username/password.</p>
  
  <p>Ideally, pressing [ENTER] would only submit the username/password combination, not selecting any other row. If that's not possible, pressing [ENTER] should not do anything.</p>
  
  <p>If have tried the following javascript code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;                
      function KeyPressed(sender, eventArgs) {
          if (eventArgs.get_keyCode() == 13) 
          {
              alert("Cancelling event");
              eventArgs.set_cancel(true);
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>The alert box is raised, but the [ENTER] event is not interrupted.</p>
  
  <p><strong>Edit:</strong> Note that the alert is for testing only!</p>
  
  <p>I have also added this code to my RadGrid control to add KeyPress capture</p>
  
  <pre><code>    &lt;ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true" ClientEvents-OnKeyPress="KeyPressed" AllowKeyboardNavigation="true"&gt;
          &lt;Selecting AllowRowSelect="True" /&gt;
      &lt;/ClientSettings&gt;
  </code></pre>
  
  <p>My question is: How can I interrupt the [ENTER] keypress event? Or modify its behavior?
  Any hints will be appreciated</p>
  
  <hr>
  
  <p>I am using VB.net on Visual Studio 2008.
  I am using ASP.net version 2.0</p>