4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 25 Nov 2009, 08:49 AM
Hello Pradeep,
You can set the ReadOnly property for the columns which are not editable.
<telerik:GridBoundColumn DataField="ContactName" ReadOnly="true" HeaderText="ContactName"
UniqueName="ContactName">
</telerik:GridBoundColumn>
Regards,
Shinu.
You can set the ReadOnly property for the columns which are not editable.
<telerik:GridBoundColumn DataField="ContactName" ReadOnly="true" HeaderText="ContactName"
UniqueName="ContactName">
</telerik:GridBoundColumn>
Regards,
Shinu.
0
pradeep k
Top achievements
Rank 1
answered on 25 Nov 2009, 09:40 AM
thank you for the reply,
It is working, but when i click on add new record command, i want all the columns to show for entering the values.
0
Princy
Top achievements
Rank 2
answered on 25 Nov 2009, 10:31 AM
Hi Pradeep K,
Try the following approach by setting the ReadOnly property explicitly when in EditMode, in order to to show all the columns while inserting record.
CS:
Thanks,
Princy.
Try the following approach by setting the ReadOnly property explicitly when in EditMode, in order to to show all the columns while inserting record.
CS:
| protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| foreach (GridColumn col in RadGrid1.Columns) |
| { |
| if (col.ColumnType == "GridBoundColumn" && col.UniqueName == "ContactName") |
| { |
| if (e.CommandName == RadGrid.EditCommandName) |
| { |
| (col as GridBoundColumn).ReadOnly = true; |
| col.Visible = false; |
| } |
| else |
| { |
| (col as GridBoundColumn).ReadOnly = false; |
| col.Visible = true; |
| } |
| } |
| } |
| } |
Thanks,
Princy.
0
pradeep k
Top achievements
Rank 1
answered on 25 Nov 2009, 10:33 AM
thank you.