This is a migrated thread and some comments may be shown as answers.

RadGrid, on click of EDIT perform Cancel

1 Answer 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Computer Surgeon
Top achievements
Rank 1
Computer Surgeon asked on 24 Dec 2008, 12:34 PM
Hi,
           In RadGrid when user click EDIT by checking a condition if 'TRUE' allow edit operation Else display "This particular record cannot be edited".
           In RadGrid1_ItemCommand
                if e.CommandName == "Edit"
               {
                  if (true)
                     allow edit
                 else
                       RadGrid1.MasterTableView.ClearEditItems();
                     alert(This particular record cannot be edited);  // I need to perform cancel edit operation here itself
             }

I can't do RadGrid1.MasterTableView.ClearEditItems(); in RadGrid1_UpdateCommand(){}

1 Answer, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 2
answered on 27 Dec 2008, 08:15 PM
I use this (excuse the VB.NET syntax):

 

Private Sub RadGrid1_InsertCommand1(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.InsertCommand
' Grab new data from form and Create database Insert command
Try
   ' PerformInsert
Catch
  ' Alert user that add can not be done
  ' line below completes the update process
  e.canceled = True
End Try

 

Tags
Grid
Asked by
Computer Surgeon
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 2
Share this question
or