none
...DataMember cannot be changed during the databinding phase ...

    Question

  • Hello,

    I have made some lightweight customizations of the CRM 2011 interface. Use the Sitemap editor available on CodePlex I have created / modified groups with
    great success. Next came delivering content within those new groups. If I create and link the group to a simple "Hello World" page everything works great. The problem comes when I step up the complexity of the target page. In this case I have a Telerik control that for some reason is not getting along with CRM 2011. If I run the page outside of CRM 2011 it works perfectly but run under CRM and it fails with the stack below. The stack is kind of baffling me as I don't see how it could be happening with such a simple page. As a final note I tried enabling tracing but it isn't working. If I get that functioning I'll update this post with anything from the trace.

    I would be very appreciative of any ideas or further reading before I have to burn an MSDN support case.

    JB

    Error Details:

    Exception of type 'System.Web.HttpUnhandledException' was thrown.
    Full Stack:

    [HttpException: Data properties on data control 'RadTreeList1' such as DataSource, DataSourceID, and DataMember cannot be changed during the databinding phase of the control.] at System.Web.UI.WebControls.BaseDataBoundControl.OnDataPropertyChanged() at Telerik.Web.UI.RadTreeList.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) at Telerik.Web.UI.RadTreeList.PerformDataBinding(IEnumerable data) at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.WebControls.CompositeDataBoundControl.get_Controls() at Telerik.Web.UI.RadFormDecorator.FindAndDecorateControls(Control parent) at Telerik.Web.UI.RadFormDecorator.FindAndDecorateControls(Control parent) at Telerik.Web.UI.RadFormDecorator.FindAndDecorateControls(Control parent) at Telerik.Web.UI.RadFormDecorator.FindAndDecorateControls(Control parent) at Telerik.Web.UI.RadFormDecorator.ControlPreRender() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.] at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    C# Binding Code:

    protected void BuildTreeListDataSource()
            {
                string currentDir = Server.MapPath("~/LotusDirectory");
                DirectoryInfo di = new DirectoryInfo(currentDir);
    
    
                using (StreamWriter writer = new StreamWriter(Server.MapPath("~/LotusStructure.xml")))
                {
                    writer.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
                    writer.WriteLine("<Items>");
                    TraverseFolder(di, writer, currentDir);
                    foreach (DirectoryInfo dInfo in di.GetDirectories())
                    {
                        writer.WriteLine("<item name=\"" + dInfo.Name + "\" parentName=\"\" type=\"Folder\" size=\"\" modified=\"" + dInfo.LastWriteTime.ToShortDateString() + "\" path=\"\"></item>");
                    }
                    foreach (FileInfo fInfo in di.GetFiles())
                    {
                        writer.WriteLine("<item name=\"" + fInfo.Name + "\" parentName=\"\" type=\"Image\" size=\"" + fInfo.Length + "\" modified=\"" + fInfo.LastWriteTime.ToShortDateString() + "\" path=\"" + fInfo.FullName + "\"></item>");
                    }
                    writer.WriteLine("</Items>");
                }
                XmlDataSource1.DataBind();
            }

    Turns out I had tracing enabled from the get go...No confusion in this kb article:

    http://support.microsoft.com/kb/907490

    Required registry entries

    TraceDirectory String C:\CRMTrace

    *:ErrorDirectory : c:\crmdrop\logsEnabled

    ...the TraceDirectory registry key is ignored. For tracing on the
    Microsoft Dynamics CRM 4.0 server and the Microsoft Dynamics CRM 2011
    server, the trace log file is created in the following folder:

    <var>Drive</var>:\Program Files\Microsoft Dynamics CRM\Trace

    Trace Output:

    Pretty much the same as the stack dump.

    • Edited by zzpluralza Thursday, November 29, 2012 3:10 PM
    Thursday, November 29, 2012 2:22 PM

Answers

  • So I needed to get this resolved and contacted MSDN support to burn a ticket. Turns out the problem was quite simple...if you knew what you were doing....which I didn't. To start you need to know that I had modified the sitemap by adding a new group and sub-group. The sub-group pointed to a folder that I had placed in the crmweb folder. Well Mr. Rodrigues a very knowledgeable support engineer in Bangalore informed me in literally under 3 minutes that this sort of nesting was not supported and to move my custom files to a seperate web.

    After moving all my customizations to a seperate web I then updated my sitemap and reset w3 svc. Works like a charm.

    Old Sitemap:

    <SubArea Icon="/_imgs/CurricLibrary_24x24.png" Id="nav_Curriculum" Url="/Curriculumn/FolderStructure.aspx" ResourceId="Homepage_Curriculum" ...>

    Correct Sitemap: (Note the URL difference)

    <SubArea Icon="/_imgs/CurricLibrary_24x24.png" Id="nav_Curriculum" Url="http://troubleshooting.com/" ResourceId="Homepage_Curriculum" ...>
    JB

    • Marked as answer by zzpluralza Friday, November 30, 2012 12:10 AM
    Friday, November 30, 2012 12:09 AM