title: Restrict button click on telerik radgridview cellValidating event - winforms
body: <p>I was testing its cellValidating event which has some problem or may be i am missing something. When the radgridview cell in in edit mode i  cannot click  anywhere on the form thats fine here. But when i click on  button, code executes and my form hangs. So my question is how can i  disable code execution on button click when radgridview cell is in edit mode during cellValidating event. Note: When i debug code and insert breakpoints on cellValidating event and button. Code works well and button code does not executes. Following is the code that i am using.If anyone can immediate answer i shall be very thankful to him.</p>
  
  <p>Private Sub rgv_CellValidating(sender As System.Object, e As Telerik.WinControls.UI.CellValidatingEventArgs) Handles rgv.CellValidating</p>
  
  <pre><code>        Dim column As GridViewDataColumn = TryCast(e.Column, GridViewDataColumn)
      If TypeOf e.Row Is GridViewDataRowInfo AndAlso column IsNot Nothing AndAlso column.Name = "ProductId" Then
          If String.IsNullOrEmpty(DirectCast(e.Value, String)) OrElse DirectCast(e.Value, String).Trim() = String.Empty Then
              e.Cancel = True
              DirectCast(e.Row, GridViewDataRowInfo).ErrorText = "Validation error!"
          Else
              DirectCast(e.Row, GridViewDataRowInfo).ErrorText = String.Empty
          End If
      End If
  </code></pre>