Distinct error:
The name ‘ExpandMode’ does not exist in the current context
Code:
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack && !this.sectionTree.IsCallBack)
{
//populate the first level of tree nodes
foreach (SiteSection section in SiteSectionCollection.GetRootSections())
{
RadTreeNode node = new RadTreeNode(section.Name, section.AssetId.ToString());
node.ExpandMode = ExpandMode.ServerSideCallBack;
this.sectionTree.Nodes.Add(node);
}
}
}
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.
One thing to keep in mind is that the RadControls for ASP.NET AJAX are different from the RadControls for ASP.NET. The later (non-AJAX controls) are quite old at this time, and lack a lot of the functionality that the new controls (ASP.NET AJAX) will contain. This can cause some API calls to be different, as you have seen above, but taking a look over the demos or documentation to look at the functionality you currently have implemented is a good step for figuring out how to implement them in this new product.
As for the issue at hand here, you should just be able to use the TreeNodeExpandMode property which is part of the RadControls for ASP.NET AJAX, as opposed to the ExpandMode which is a part of the RadControls for ASP.NET. For more information about the various expand modes you can look into this demo.