用于 ASP.NET AJAX 的 RadControls 升级 - “Telerik.Web.UI.RadTreeNodeEventArgs” ...错误

发布于 2024-12-02 08:38:18 字数 4467 浏览 4 评论 0原文

明显错误:

“Telerik.Web.UI.RadTreeNodeEventArgs”不包含“SourceDragNode”的定义,并且没有扩展方法“SourceDragNode”接受“Telerik.Web.UI.RadTreeNodeEventArgs”类型的第一个参数可以找到(您是否缺少 using 指令或程序集引用?)

代码:

  protected void rtvContainers_NodeDrop(object o, Telerik.Web.UI.RadTreeNodeEventArgs e)
  {
     // Update the parent container for the source node
     this.EditObject = OrganizationContainer.Get(new Guid(e.SourceDragNode.Value));
     ViewState["EditId"] = this.EditObject.OrganizationContainerId;
     this.EditObject.ParentOrganizationContainerId = new Guid(e.DestDragNode.Value);
     this.BindForm();
     this.EditObject.EndEdit();
     this.EditObject.Save();

     // Rebind the tree
     if (rtvContainers.SelectedNode != null)
        rtvContainers.SelectedNode.Selected = false;
     e.SourceDragNode.Selected = true;
     BindContainersTreeview();
     BindParentContainerCombobox();
  }

明显错误:

“Telerik.Web.UI.RadTreeNodeEventArgs”不包含“DestDragNode”的定义,并且找不到接受“Telerik.Web.UI.RadTreeNodeEventArgs”类型的第一个参数的扩展方法“DestDragNode”(您是否缺少 using 指令或程序集引用?)

代码:

  protected void rtvContainers_NodeDrop(object o, Telerik.Web.UI.RadTreeNodeEventArgs e)
  {
     // Update the parent container for the source node
     this.EditObject = OrganizationContainer.Get(new Guid(e.SourceDragNode.Value));
     ViewState["EditId"] = this.EditObject.OrganizationContainerId;
     this.EditObject.ParentOrganizationContainerId = new Guid(e.DestDragNode.Value);
     this.BindForm();
     this.EditObject.EndEdit();
     this.EditObject.Save();

     // Rebind the tree
     if (rtvContainers.SelectedNode != null)
        rtvContainers.SelectedNode.Selected = false;
     e.SourceDragNode.Selected = true;
     BindContainersTreeview();
     BindParentContainerCombobox();
  }

明显错误:

“Telerik.Web.UI.RadTreeNodeEventArgs”不包含“NodeClicked”的定义,并且找不到接受“Telerik.Web.UI.RadTreeNodeEventArgs”类型的第一个参数的扩展方法“NodeClicked”(您是否缺少 using 指令或程序集引用?)

代码:

  protected void sectionTree_NodeExpand(object o, RadTreeNodeEventArgs e)
  {
     Guid? parentId = NullableParser.GetNullable<Guid>(e.NodeClicked.Value);
     if (parentId.HasValue)
     {
        foreach (SiteSection section in SiteSectionCollection.GetChildrenOf(parentId.Value))
        {
           RadTreeNode node = new RadTreeNode(section.Name, section.AssetId.ToString());
           node.ExpandMode = ExpandMode.ServerSideCallBack;
           e.NodeClicked.Nodes.Add(node);
        }
     }
  }

明显错误:

'Telerik.Web.UI.RadTreeNodeEventArgs' 不包含找不到“NodeEdited”的定义,并且找不到接受“Telerik.Web.UI.RadTreeNodeEventArgs”类型的第一个参数的扩展方法“NodeEdited”(您是否缺少 using 指令或程序集引用?)

代码:< /strong>

  protected void rtvContainers_NodeEdit(object o, RadTreeNodeEventArgs e)
  {
     // Update the parent container for the source node
     this.EditObject = OrganizationContainer.Get(new Guid(e.NodeEdited.Value));
     ViewState["EditId"] = this.EditObject.OrganizationContainerId;
     this.EditObject.Name = e.NodeEdited.Text;
     this.BindForm();
     this.EditObject.EndEdit();
     this.EditObject.Save();
  }

明显错误:

'Telerik.Web.UI.RadTreeNodeEventArgs' 不包含 'NewText' 的定义,并且没有扩展方法 'NewText' 接受可以找到“Telerik.Web.UI.RadTreeNodeEventArgs”类型的第一个参数(您是否缺少 using 指令或程序集引用?)

代码:

  protected void RadTreeView1_NodeEdit(object o, RadTreeNodeEventArgs e)
  {
     // Load the folder being edited
     RadTreeNode nodeEdited = e.NodeEdited;
     Guid currentFolderId = new Guid(nodeEdited.Value);

     try
     {
        // Try to change the folder's name
        UpdateFolder(currentFolderId, e.NewText);
        nodeEdited.Text = e.NewText;
     }
     catch (Exception ex)
     {
        errorValidator.IsValid = false;
        errorValidator.ErrorMessage = "Unable to update folder name: " + e.NodeEdited.Text;
        LogHelper.Log(ex);
     }
  }

背景:

从从“RadControls for ASP.NET”到“RadControls for ASP.NET AJAX”,我遇到了几个问题。 web.config 文件已由升级向导转换。我一开始遇到了 233 个 .NET 编译错误(28 个不同的错误),我很快就解决了这些错误,但由于 API 的剧烈更改,我仍然有 36 个错误(13 个不同的问题)尚未解决。我将把这 13 个错误作为堆栈溢出问题发布,以节省我一些时间。在等待的同时,我将尝试下载他们的控件演示,了解控件如何在最新版本中工作,并亲自回答其他人没有回答的问题。

Distinct error:

'Telerik.Web.UI.RadTreeNodeEventArgs' does not contain a definition for 'SourceDragNode' and no extension method 'SourceDragNode' accepting a first argument of type 'Telerik.Web.UI.RadTreeNodeEventArgs' could be found (are you missing a using directive or an assembly reference?)

Code:

  protected void rtvContainers_NodeDrop(object o, Telerik.Web.UI.RadTreeNodeEventArgs e)
  {
     // Update the parent container for the source node
     this.EditObject = OrganizationContainer.Get(new Guid(e.SourceDragNode.Value));
     ViewState["EditId"] = this.EditObject.OrganizationContainerId;
     this.EditObject.ParentOrganizationContainerId = new Guid(e.DestDragNode.Value);
     this.BindForm();
     this.EditObject.EndEdit();
     this.EditObject.Save();

     // Rebind the tree
     if (rtvContainers.SelectedNode != null)
        rtvContainers.SelectedNode.Selected = false;
     e.SourceDragNode.Selected = true;
     BindContainersTreeview();
     BindParentContainerCombobox();
  }

Distinct error:

'Telerik.Web.UI.RadTreeNodeEventArgs' does not contain a definition for 'DestDragNode' and no extension method 'DestDragNode' accepting a first argument of type 'Telerik.Web.UI.RadTreeNodeEventArgs' could be found (are you missing a using directive or an assembly reference?)

Code:

  protected void rtvContainers_NodeDrop(object o, Telerik.Web.UI.RadTreeNodeEventArgs e)
  {
     // Update the parent container for the source node
     this.EditObject = OrganizationContainer.Get(new Guid(e.SourceDragNode.Value));
     ViewState["EditId"] = this.EditObject.OrganizationContainerId;
     this.EditObject.ParentOrganizationContainerId = new Guid(e.DestDragNode.Value);
     this.BindForm();
     this.EditObject.EndEdit();
     this.EditObject.Save();

     // Rebind the tree
     if (rtvContainers.SelectedNode != null)
        rtvContainers.SelectedNode.Selected = false;
     e.SourceDragNode.Selected = true;
     BindContainersTreeview();
     BindParentContainerCombobox();
  }

Distinct error:

'Telerik.Web.UI.RadTreeNodeEventArgs' does not contain a definition for 'NodeClicked' and no extension method 'NodeClicked' accepting a first argument of type 'Telerik.Web.UI.RadTreeNodeEventArgs' could be found (are you missing a using directive or an assembly reference?)

Code:

  protected void sectionTree_NodeExpand(object o, RadTreeNodeEventArgs e)
  {
     Guid? parentId = NullableParser.GetNullable<Guid>(e.NodeClicked.Value);
     if (parentId.HasValue)
     {
        foreach (SiteSection section in SiteSectionCollection.GetChildrenOf(parentId.Value))
        {
           RadTreeNode node = new RadTreeNode(section.Name, section.AssetId.ToString());
           node.ExpandMode = ExpandMode.ServerSideCallBack;
           e.NodeClicked.Nodes.Add(node);
        }
     }
  }

Distinct error:

'Telerik.Web.UI.RadTreeNodeEventArgs' does not contain a definition for 'NodeEdited' and no extension method 'NodeEdited' accepting a first argument of type 'Telerik.Web.UI.RadTreeNodeEventArgs' could be found (are you missing a using directive or an assembly reference?)

Code:

  protected void rtvContainers_NodeEdit(object o, RadTreeNodeEventArgs e)
  {
     // Update the parent container for the source node
     this.EditObject = OrganizationContainer.Get(new Guid(e.NodeEdited.Value));
     ViewState["EditId"] = this.EditObject.OrganizationContainerId;
     this.EditObject.Name = e.NodeEdited.Text;
     this.BindForm();
     this.EditObject.EndEdit();
     this.EditObject.Save();
  }

Distinct error:

'Telerik.Web.UI.RadTreeNodeEventArgs' does not contain a definition for 'NewText' and no extension method 'NewText' accepting a first argument of type 'Telerik.Web.UI.RadTreeNodeEventArgs' could be found (are you missing a using directive or an assembly reference?)

Code:

  protected void RadTreeView1_NodeEdit(object o, RadTreeNodeEventArgs e)
  {
     // Load the folder being edited
     RadTreeNode nodeEdited = e.NodeEdited;
     Guid currentFolderId = new Guid(nodeEdited.Value);

     try
     {
        // Try to change the folder's name
        UpdateFolder(currentFolderId, e.NewText);
        nodeEdited.Text = e.NewText;
     }
     catch (Exception ex)
     {
        errorValidator.IsValid = false;
        errorValidator.ErrorMessage = "Unable to update folder name: " + e.NodeEdited.Text;
        LogHelper.Log(ex);
     }
  }

Background:

When upgrading from "RadControls for ASP.NET" to "RadControls for ASP.NET AJAX", I ran into several issues. The web.config file was converted by the Upgrade Wizard. I started with 233 .NET compilation errors (28 distinct errors) which I quickly resolved, but I still have 36 errors (13 distinct issues) left from drastic API changes that I still haven't resolved. I will post these 13 errors as questions on stack overflow to save me some time. While I'm waiting I will try downloading their control demos and understand how the controls work for their newest release and answer them myself for those others haven't answered.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自我难过 2024-12-09 08:38:19

发现所有这些错误都来自旧的演示项目...我在所有这些方法上单击了“查找所有引用”,但没有出现任何错误。因此,我将它们注释掉并忘记它们,因为它们不在最新版本的 API 中。

Found out all of these errors were from old demo projects... I clicked "Find All References" on all of these methods, and none came up. So I'm commenting them out and forgetting about them since they're not in the API of the newest release.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文