6 Answers, 1 is accepted
0
Accepted

Princy
Top achievements
Rank 2
answered on 14 Mar 2012, 03:03 PM
Hello,
Try setting ReadOnly property of the required Column as true.
ASPX:
Thanks,
Princy
Try setting ReadOnly property of the required Column as true.
ASPX:
<
telerik:GridBoundColumn
UniqueName
=
"EmployeeID"
HeaderText
=
"EmployeeID"
DataField
=
"EmployeeID"
ReadOnly
=
"true"
></
telerik:GridBoundColumn
>
Thanks,
Princy
0

KUHELI
Top achievements
Rank 1
answered on 20 Mar 2012, 08:58 AM
Thanks Princy. it worked for me. But now I am facing another problem. I am using inline editing. Earlier it was working fine but I made couple of columns read only and now If I am updating the same I am getting an exception "Microsoft JScript run time error: sys.webforms.pagerequestmanager.servererrorexception: specified argument was out of the range of valid values." Please suggest.
Thanks
Thanks
0

Princy
Top achievements
Rank 2
answered on 20 Mar 2012, 11:48 AM
Hello Kuheli,
Glad to know that it worked for you.
The "Microsoft JScript run time error:" cited on your post could be due to several reasons. In order to help you better, please post the the code that you are working on.
Regards,
Princy.
Glad to know that it worked for you.
The "Microsoft JScript run time error:" cited on your post could be due to several reasons. In order to help you better, please post the the code that you are working on.
Regards,
Princy.
0

KUHELI
Top achievements
Rank 1
answered on 21 Mar 2012, 08:19 AM
I tried again and it worked.
Thanks for your help.
Thanks for your help.
0

KUHELI
Top achievements
Rank 1
answered on 21 Mar 2012, 01:04 PM
Hi, After implementing read only property to couple of columns if I am using IsItemInserted to add a new row. Columns are read only. Can we make all the columns editable?
Thanks
Thanks
0

Princy
Top achievements
Rank 2
answered on 21 Mar 2012, 01:52 PM
Hello Kuheli,
In order to make the column editable in insert mode you can try the following approach in ItemDataBound event instead of setting ReadOnly property in aspx.
C#:
Thanks,
Princy.
In order to make the column editable in insert mode you can try the following approach in ItemDataBound event instead of setting ReadOnly property in aspx.
C#:
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item.OwnerTableView.IsItemInserted && e.Item
is
GridEditFormInsertItem)
//item is about to be inserted
{
GridEditFormInsertItem insertItem = (GridEditFormInsertItem)e.Item;
TextBox txtid = (TextBox)insertItem[
"UniqueName"
].Controls[0];
txtid.ReadOnly =
false
;
}
if
(!(e.Item
is
GridEditFormInsertItem) && e.Item.IsInEditMode)
//item is about to be edit
{
GridEditFormItem editItem = (GridEditFormItem)e.Item;
TextBox txtid = (TextBox)editItem[
"UniqueName"
].Controls[0];
txtid.ReadOnly =
true
;
}
}
Thanks,
Princy.