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

[Solved] Radgrid candel edit mode does not work

1 Answer 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jessie
Top achievements
Rank 1
Jessie asked on 13 Jul 2009, 07:19 PM
How to cancel edit mode in radgrid1_ItemCommand for C#?

I use the following code in radgrid1_ItemCommand, but doesn't work.-- the grid is still edit mode after the following line called. I want it out of the edit mode.

 

if (e.CommandName == "Edit")

 


{
  // if validation fails, can not edit -cancel edit mode   

e.Item.Edit =

false;
}


Thanks!

 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Jul 2009, 05:09 AM
Hello Jessie,

Try out the following code snippet instead to achieve the required scenario:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName == "Edit"
        { 
            // if validation fails, can not edit -cancel edit mode                
               
                    e.Canceled = true;              
        } 
   } 

Thanks
Princy.
Tags
Grid
Asked by
Jessie
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or