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

Editing a row

1 Answer 21 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Janaki
Top achievements
Rank 1
Janaki asked on 26 Jun 2012, 09:13 AM
Hi all,

How can I make a boundcolumn readonly while editing a row?

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 26 Jun 2012, 09:22 AM
Hi Janaki,

Try the following code snippet to make a BoundColumn ReadOnly  while editing only.

C#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
        if (e.Item is GridEditableItem && e.Item.IsInEditMode && !(e.Item is GridEditFormInsertItem))
        {
            GridEditableItem eitem = (GridEditableItem)e.Item;
            TextBox txt = (TextBox)eitem["UniqueName"].Controls[0];
            txt.ReadOnly = true;
        }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Janaki
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or