Hello, I'm using the newest version of RadControls for ASP.NET, and I've got a problem with launching the edit mode for RadGrid - it works like a charm for one instance of RadGrid, but for another - which is hierarchical - it doesn't. I am able to set edit mode manually - by EditColumn only.
My hierarchical grid looks is created in following way:
And function, which is trying to turn on edit mode, looks like:
Any help would be appreciated.
My hierarchical grid looks is created in following way:
<
telerik:RadGrid
runat
=
"server"
ID
=
"Grid"
EnableAJAX
=
"True"
AllowMultiRowEdit
=
"True"
EditMode
=
"InPlace"
OnItemDataBound
=
"Grid_ItemDataBound"
OnDetailTableDataBind
=
"Grid_DetailTableDataBind"
OnPreRender
=
"Grid_PreRender"
OnUpdateCommand
=
"Grid_ItemUpdate"
OnItemCreated
=
"Grid_ItemCreated"
DataSourceID
=
"SqlDataSource1"
AutoGenerateColumns
=
"false"
>
<
MasterTableView
DataKeyNames
=
"MASTER_ID"
>
<
DetailTables
>
<
telerik:GridTableView
EditMode
=
"InPlace"
Name
=
"Child"
AutoGenerateColumns
=
"False"
Width
=
"100%"
DataKeyNames
=
"CHILD_ID"
runat
=
"server"
>
<
Columns
>
<
telerik:GridEditCommandColumn
/>
<
telerik:GridBoundColumn
DataField
=
"CHILD_ID"
HeaderText
=
"CHILD_ID"
ReadOnly
=
"True"
SortExpression
=
"CHILD_ID"
UniqueName
=
"CHILD_ID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CHILD_Text"
HeaderText
=
"CHILD_Text"
ReadOnly
=
"False"
SortExpression
=
"CHILD_Text"
UniqueName
=
"CHILD_Text"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"CHILD_ID"
HeaderText
=
"CHILD_ID"
ReadOnly
=
"True"
SortExpression
=
"CHILD_ID"
UniqueName
=
"CHILD_ID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"MASTER_ID"
HeaderText
=
"MASTER_ID"
ReadOnly
=
"True"
SortExpression
=
"MASTER_ID"
UniqueName
=
"MASTER_ID"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
And function, which is trying to turn on edit mode, looks like:
private void Grid_PreRender(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
foreach(GridItem item in Grid.MasterTableView.Items)
{
if (item is GridEditableItem)
{
GridEditableItem editableItem= item as GridDataItem;
editableItem.Edit = true;
}
}
Grid.Rebind();
}
}
Any help would be appreciated.