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

Insert Columns Vs Edit Columns

1 Answer 27 Views
Grid
This is a migrated thread and some comments may be shown as answers.
New User
Top achievements
Rank 1
New User asked on 12 Nov 2010, 05:20 PM
I currently have a radgrid with 6 columns.  When the user chooses to Edit the row they are able to edit columns 4-6.  If the user selects to insert a new row they may edit columns 1-6.  Can someone help me understand how to do this?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 15 Nov 2010, 07:28 AM
Hello,
 You can try the following code snippet to disable the columns in edit form.  

C#:
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
   {
       if (e.Item is GridEditFormItem && e.Item.IsInEditMode && !(e.Item is GridEditFormInsertItem) )
       {
           GridEditableItem editableitem = (GridEditableItem)e.Item;
           (editableitem["LastName"].Controls[0] as TextBox).Enabled = false;
 
       }
   }

Thanks,
Princy.
Tags
Grid
Asked by
New User
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or