我有一个Radgrid调用Grid1。 在RadGrid内部,我喜欢以编程方式使字段RadEditor不可见
<telerik:GridTemplateColumn DataField="Description" FilterControlAltText="Filter Description column"
HeaderText="Description" SortExpression="Description" UniqueName="Description">
<EditItemTemplate>
<telerik:RadEditor StripFormattingOnPaste="MSWord" ID="LimitEdit" runat="server" Content='<%# Bind("Description") %>'
Skin="Windows7">
</telerik:RadEditor>
</EditItemTemplate>
我尝试了以下代码,但似乎没有用:
if (e.CommandName == "Edit")
{
var gridItem = e.Item as GridEditableItem;
if ("ActionItems".Equals(e.Item.OwnerTableView.Name))
{
var radEditor = editItem.FindControl("LimitEdit") as RadEditor;
radEditor.Visible = false;
}
}
当我执行上面的代码时,它说找不到LimitEdit