请我存在这个错误,我无法摆脱它我在另一个用户控件内有一个用户控件,子控件包含RadAjaxPanel。
父控件包含一个Radgrid,希望有一个editformTemplate,并在其中加载子控件,我将在代码中显示:
<EditFormSettings EditFormType="Template">
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn>
<FormStyle BackColor="#FCFCFC"></FormStyle>
<FormTemplate>
<table>
<tr>
<td class="LblWidth" style="padding-top: 5px;">
<asp:Label ID="Label1" runat="server" Text="Center logo:">
</asp:Label>
</td>
<td style="padding-top: 10px;">
<uc1:MAYAUploadImageControl ID="UploadImageControl1" runat="server" />
<span class="redSpan">
</span>
</td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
这是父控件
儿童控制是:
<telerik:RadAjaxPanel ID="ajaxPanel" runat="server" >
<asp:HiddenField ID="hf_FileName" runat="server" />
<asp:HiddenField ID="ImageChanged" runat="server" Value="0" />
<asp:Label ID="Label1" runat="server" Text="New Picture:"></asp:Label>
<br />
<telerik:RadImageEditor ID="RIEditor" runat="server" Width="180" Height="150" ToolBarMode="Default"
EnableResize="false" EnableTheming="false" BackColor="Transparent" OnImageSaving="ImageEditor_ImageSaving"
StatusBarMode="Hidden" CanvasMode="No" ToolBarPosition="top" BorderStyle="Solid"
BorderWidth="0px" Visible="false" OnClientImageLoad="ImageLoad" OnClientImageChanged="ImageChanged">
<Tools>
<telerik:ImageEditorToolGroup>
<telerik:ImageEditorTool CommandName="Flip" />
<telerik:ImageEditorTool CommandName="FlipVertical" />
<telerik:ImageEditorTool CommandName="FlipHorizontal" />
<telerik:ImageEditorToolSeparator />
<telerik:ImageEditorTool CommandName="Crop" />
<telerik:ImageEditorTool CommandName="Resize" />
<telerik:ImageEditorToolSeparator />
<telerik:ImageEditorTool CommandName="Reset" />
</telerik:ImageEditorToolGroup>
</Tools>
</telerik:RadImageEditor>
</telerik:RadAjaxPanel>
父控件ascx.cs:
protected void GridCenters_ItemCommand(object sender,Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.UpdateCommandName || e.CommandName == RadGrid.PerformInsertCommandName)
{ controls_CustomControls_UploadImageControl_Maya ctrl = e.Item.FindControl("UploadImageControl1") as controls_CustomControls_UploadImageControl_Maya;
if (ctrl.ImageFileName != "")
{
//string imageFileName = (e.Item.FindControl("AsyncUpload1") as RadAsyncUpload).UploadedFiles[0].FileName;
ctrl.SaveImage();
logo = ctrl.ImageFileName != "" ? ConvertImgToBinary(ctrl.ImageFileName) : null;
}
switch (e.CommandName)
{
case "Update":
if(!EntertainmentDataAccess.UpdateCenter(long.Parse(e.CommandArgument.ToString()), centerName, centerType, logo, website, "", isactive, "", mail, tel, Mobile, fax, country, casa, town, street, BuildNb, POB))
{
LblError.Text = "Branch cannot be updated";
}
else
{
LblError.Text = "Branch updated successfully";
GridEditCommandColumn editColumn = (GridEditCommandColumn)GridCenters.MasterTableView.GetColumn("EDIT");
editColumn.Visible = true;
GridCenters.DataBind(); // here i'm getting the error
}
break;
}
}
我为我凌乱的解释感到抱歉,但我已经在这个问题上停留了几天而且我无法解决它
答案 0 :(得分:0)
根据以下链接中的信息,看起来RadAjaxPanel
正在从它所属的Control Collection中移动或删除。第三个链接包含特定于Telerik的解决方法。