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

diable edit in radgrid

1 Answer 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dilip
Top achievements
Rank 1
Dilip asked on 01 Mar 2009, 05:21 PM
Is it possible to disable editing in radgrid. I would still like the user to inset and delete but should not be allowed to edit a record.

Thanks
Dilip

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Mar 2009, 05:22 AM
Hello Dilip,

If you do not want to display an Edit column in your grid, then you can either avoid using EditCommandColumn or set AutoGenerateEditColumn to false.
If you want to display Edit column but still disable editing for rows using code, then you can try the following:
cs:
 protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
       if (e.CommandName == RadGrid.EditCommandName) 
        { 
            e.Canceled = true
        } 
    } 

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