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

column read only

1 Answer 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
beeta one
Top achievements
Rank 1
beeta one asked on 28 Aug 2012, 06:05 AM
hii,,
I want to make a cloumn readonly in editing only not in insert mode,can you help me?

thanks

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 28 Aug 2012, 06:28 AM
Hello,

<Columns>
                  <telerik:GridBoundColumn HeaderText="ID" DataField="ID" UniqueName="ID">
                  </telerik:GridBoundColumn>
              </Columns>

protected void RadGrid3_ItemDataBound(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridEditableItem && e.Item.IsInEditMode)
       {
 
           if (e.Item is GridEditFormInsertItem)
           {
                // Insert
           }
           else
           {
               //edit
               GridEditableItem item = e.Item as GridEditableItem;
               (item["ID"].Controls[0] as TextBox).ReadOnly = true;
           }
       }
   }


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
beeta one
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or