Hi all,
I want to set a column to ReadOnly=True at EditMode, but at InsertMode ReadOnly=False. Please advise how to do it.
I did as below but it didn't work. Please help.
But I got error "Index was outside the bounds of the array." at the below code ..
Many Thanks
I want to set a column to ReadOnly=True at EditMode, but at InsertMode ReadOnly=False. Please advise how to do it.
I did as below but it didn't work. Please help.
Private
Sub
RadGrid1_ItemCommand(
ByVal
source
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridCommandEventArgs)
Handles
RadGrid1.ItemCommand
If
e.CommandName = RadGrid.EditCommandName
Then
Dim
editItem
As
GridEditableItem =
CType
(RadGrid1.MasterTableView.GetItems(GridItemType.EditItem)(0), GridEditableItem)
For
Each
column
As
GridColumn
In
RadGrid1.MasterTableView.Columns
If
column.UniqueName =
"POL"
Then
Dim
txtbox
As
TextBox =
CType
(editItem (column.UniqueName).Controls(0), TextBox)
txtbox.
ReadOnly
=
True
End
If
Next
End
If
End
Sub
But I got error "Index was outside the bounds of the array." at the below code ..
If
e.CommandName = RadGrid.EditCommandName
Then
Dim
editItem
As
GridEditableItem =
CType
(RadGrid1.MasterTableView.GetItems(GridItemType.EditItem)(0), GridEditableItem)
Many Thanks